Popdown RadioMenuButton's palette

This commit is contained in:
Aleksey Lim 2009-07-31 19:56:43 +00:00
parent e0aedcd5c7
commit 2c7e2c393a

View File

@ -33,18 +33,14 @@ class RadioMenuButton(ToolButton):
self.__palette_cb(None, None) self.__palette_cb(None, None)
self.connect('notify::palette', self.__palette_cb) self.connect('notify::palette', self.__palette_cb)
self.connect('clicked', self.__clicked_cb)
def __clicked_cb(self, button):
self.on_click()
def __palette_cb(self, widget, pspec): def __palette_cb(self, widget, pspec):
if not isinstance(self.props.palette, RadioPalette): if not isinstance(self.props.palette, RadioPalette):
return return
self.props.palette.update_button() self.props.palette.update_button()
def on_click(self): def do_clicked(self):
if not self.palette: if self.palette is None:
return return
if self.palette.is_up() and \ if self.palette.is_up() and \
self.palette.palette_state == Palette.SECONDARY: self.palette.palette_state == Palette.SECONDARY:
@ -74,7 +70,7 @@ class RadioToolsButton(RadioMenuButton):
def __init__(self, **kwargs): def __init__(self, **kwargs):
RadioMenuButton.__init__(self, **kwargs) RadioMenuButton.__init__(self, **kwargs)
def on_click(self): def do_clicked(self):
if not self.selected_button: if not self.selected_button:
return return
self.selected_button.emit('clicked') self.selected_button.emit('clicked')