sugar-toolkit-gtk3/sugar/graphics/menushell.py

27 lines
609 B
Python
Raw Normal View History

import gobject
class MenuShell(gobject.GObject):
__gsignals__ = {
'activated': (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE, ([])),
'deactivated': (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE, ([])),
}
2006-10-04 00:25:03 +02:00
def __init__(self):
gobject.GObject.__init__(self)
self._menu_controller = None
def is_active(self):
return (self._menu_controller != None)
def set_active(self, controller):
if controller == None:
self.emit('deactivated')
else:
self.emit('activated')
if self._menu_controller:
self._menu_controller.popdown()
self._menu_controller = controller