Ghost/EM_effect.py
def enable_group_editing(self,event):
        """Enable editing of the properties of a group"""
        group_num=int(self.LB_added_groups.curselection()[0])
        selected_group=self.selected_groups[group_num][0]
        #
        #
        def get_new_colour():
            import tkColorChooser
            rgb,colorstring=tkColorChooser.askcolor(self.group_properties[selected_group]['colour'])
            self.group_properties[selected_group]['colour']=colorstring
            self.update_EM_effect_prediction()
            return
        self.colorbutton.configure(state=ACTIVE)
        self.colorbutton.configure(fg=self.group_properties[selected_group]['colour'])
        self.colorbutton.configure(command=get_new_colour)
        
        self.diel_var.set(self.group_properties[selected_group]['diel'])
        self.eff_diel_scale.configure(state=ACTIVE)
        def update_diel(event=None):
            """Update teh dielectric constant for a calc"""
            diel=self.diel_var.get()
            self.group_properties[selected_group]['diel']=diel
            self.update_EM_effect_prediction()
            return
        self.eff_diel_scale.configure(command=update_diel)
        self.removebutton.configure(state=ACTIVE)
        #
        # Display checkbutton
        #
        def update_on_off():
            self.group_properties[selected_group]['display']=self.display_var.get()
            self.update_EM_effect_prediction()
            return
        self.display_var.set(self.group_properties[selected_group]['display'])
        self.display_button.configure(state=ACTIVE)
        self.display_button.configure(command=update_on_off)
        #
        # Elecalc button
        #
        self.elecalc_button.configure(state=ACTIVE)
        return
Enable editing of the properties of a group
Enable editing of the properties of a group
Enable editing of the properties of a group
def enable_group_editing(self,event):
        group_num=int(self.LB_added_groups.curselection()[0])
        selected_group=self.selected_groups[group_num][0]
        def get_new_colour():
            import tkColorChooser
            rgb,colorstring=tkColorChooser.askcolor(self.group_properties[selected_group]['colour'])
            self.group_properties[selected_group]['colour']=colorstring
            self.update_EM_effect_prediction()
            return
        self.colorbutton.configure(state=ACTIVE)
        self.colorbutton.configure(fg=self.group_properties[selected_group]['colour'])
        self.colorbutton.configure(command=get_new_colour)
        self.diel_var.set(self.group_properties[selected_group]['diel'])
        self.eff_diel_scale.configure(state=ACTIVE)
        def update_diel(event=None):
            diel=self.diel_var.get()
            self.group_properties[selected_group]['diel']=diel
            self.update_EM_effect_prediction()
            return
        self.eff_diel_scale.configure(command=update_diel)
        self.removebutton.configure(state=ACTIVE)
         Display checkbutton
        def update_on_off():
            self.group_properties[selected_group]['display']=self.display_var.get()
            self.update_EM_effect_prediction()
            return
        self.display_var.set(self.group_properties[selected_group]['display'])
        self.display_button.configure(state=ACTIVE)
        self.display_button.configure(command=update_on_off)
         Elecalc button
        self.elecalc_button.configure(state=ACTIVE)
        return
def enable_group_editing ( self , event ) : group_num = int ( self . LB_added_groups . curselection ( ) [ 0 ] ) selected_group = self . selected_groups [ group_num ] [ 0 ] def get_new_colour ( ) : import tkColorChooser rgb , colorstring = tkColorChooser . askcolor ( self . group_properties [ selected_group ] [ 'colour' ] ) self . group_properties [ selected_group ] [ 'colour' ] = colorstring self . update_EM_effect_prediction ( ) return self . colorbutton . configure ( state = ACTIVE ) self . colorbutton . configure ( fg = self . group_properties [ selected_group ] [ 'colour' ] ) self . colorbutton . configure ( command = get_new_colour ) self . diel_var . set ( self . group_properties [ selected_group ] [ 'diel' ] ) self . eff_diel_scale . configure ( state = ACTIVE ) def update_diel ( event = None ) : """Update teh dielectric constant for a calc""" diel = self . diel_var . get ( ) self . group_properties [ selected_group ] [ 'diel' ] = diel self . update_EM_effect_prediction ( ) return self . eff_diel_scale . configure ( command = update_diel ) self . removebutton . configure ( state = ACTIVE ) def update_on_off ( ) : self . group_properties [ selected_group ] [ 'display' ] = self . display_var . get ( ) self . update_EM_effect_prediction ( ) return self . display_var . set ( self . group_properties [ selected_group ] [ 'display' ] ) self . display_button . configure ( state = ACTIVE ) self . display_button . configure ( command = update_on_off ) self . elecalc_button . configure ( state = ACTIVE ) return
Enable editing of the properties of a group
Enable editing of the properties of a group
"""Enable editing of the properties of a group""" # # """Update teh dielectric constant for a calc""" # # Display checkbutton # # # Elecalc button #
self
event