Exemplo n.º 1
0
    def __init__(self, items, cb, desc):
        ToggleToolButton.__init__(self)
        self.items = items
        if 'icon' in items[0] and _icon_exists(items[0]['icon']):
            self.props.icon_name = items[0]['icon']
        elif 'html' in items[0]:
            self.set_label(items[0]['html'])
#        self.set_tooltip(items[0][1])
        self.set_tooltip(desc)
        self.selected = 0
        self.connect('clicked', self.toggle_button)
        self.callback = cb
Exemplo n.º 2
0
    def __init__(self, items, cb, desc):
        ToggleToolButton.__init__(self)
        self.items = items
        if 'icon' in items[0] and _icon_exists(items[0]['icon']):
            self.props.icon_name = items[0]['icon']
        elif 'html' in items[0]:
            self.set_label(items[0]['html'])
#        self.set_tooltip(items[0][1])
        self.set_tooltip(desc)
        self.selected = 0
        self.connect('clicked', self.toggle_button)
        self.callback = cb
    def __init__(self, parent_activity, **kwargs):
        ToggleToolButton.__init__(self, 'show-hints', **kwargs)
        #self.props.tooltip = 'Show Hints'
        self.set_tooltip(_('Show Hints'))

        # Add an accelerator. In later versions of Sugar, we can just set the
        # 'accelerator' property instead.
        #self.props.accelerator = '<Ctrl>H'
        accel_group = parent_activity.get_toplevel().sugar_accel_group
        keyval, mask = Gtk.accelerator_parse('<Ctrl>H')
        # the accelerator needs to be set at the child, so the Gtk.AccelLabel
        # in the palette can pick it up.
        accel_flags = Gtk.AccelFlags.LOCKED | Gtk.AccelFlags.VISIBLE
        self.get_child().add_accelerator('clicked', accel_group, keyval, mask,
                                         accel_flags)

        self.connect('clicked', self.__hint_button_clicked_cb, parent_activity)
Exemplo n.º 4
0
    def __init__(self):
        ToggleToolButton.__init__(self, icon_name='computer-xo')

        self.set_tooltip(_("Bulletin Board"))