(self, widget)
Update the fore/background colour pickers
Update the fore/background colour pickers
Update the fore / background colour pickers
def on_color_scheme_combobox_changed(self, widget):
        """Update the fore/background colour pickers"""
        value = None
        guiget = self.builder.get_object
        active = widget.get_active()

        for key in list(self.colorschemevalues.keys()):
            if self.colorschemevalues[key] == active:
                value = key

        fore = guiget('foreground_colorbutton')
        back = guiget('background_colorbutton')
        if value == 'custom':
            fore.set_sensitive(True)
            back.set_sensitive(True)
        else:
            fore.set_sensitive(False)
            back.set_sensitive(False)

        forecol = None
        backcol = None
        if value in self.colourschemes:
            forecol = self.colourschemes[value][0]
            backcol = self.colourschemes[value][1]
            self.config['foreground_color'] = forecol
            self.config['background_color'] = backcol
        self.config.save()
def on_color_scheme_combobox_changed ( self , widget ) : value = None guiget = self . builder . get_object active = widget . get_active ( ) for key in list ( self . colorschemevalues . keys ( ) ) : if self . colorschemevalues [ key ] == active : value = key fore = guiget ( 'foreground_colorbutton' ) back = guiget ( 'background_colorbutton' ) if value == 'custom' : fore . set_sensitive ( True ) back . set_sensitive ( True ) else : fore . set_sensitive ( False ) back . set_sensitive ( False ) forecol = None backcol = None if value in self . colourschemes : forecol = self . colourschemes [ value ] [ 0 ] backcol = self . colourschemes [ value ] [ 1 ] self . config [ 'foreground_color' ] = forecol self . config [ 'background_color' ] = backcol self . config . save ( )