Example #1
0
    def set_content(self, widget):
        assert self._widget is None \
            or isinstance(self._widget, _PaletteWindowWidget)

        if self._widget is None:
            self._widget = _PaletteWindowWidget(self)
            self._setup_widget()

            self._palette_box = Gtk.VBox()
            self._palette_box.pack_start(self._primary_event_box, False, True,
                                         0)
            self._palette_box.pack_start(self._secondary_box, True, True, 0)

            self._widget.add(self._palette_box)
            self._palette_box.show()
            height = style.GRID_CELL_SIZE - 2 * self._widget.get_border_width()
            self._primary_event_box.set_size_request(-1, height)

        if self._content.get_children():
            self._content.remove(self._content.get_children()[0])

        if widget is not None:
            widget.connect('button-release-event',
                           self.__widget_button_release_cb)
            self._content.add(widget)
            self._content.show()
        else:
            self._content.hide()

        self._content_widget = widget

        self._update_accept_focus()
        self._update_separators()
Example #2
0
    def set_content(self, widget):
        assert self._widget is None \
                or isinstance(self._widget, _PaletteWindowWidget)

        if self._widget is None:
            self._widget = _PaletteWindowWidget(self)
            self._setup_widget()

            self._palette_box = Gtk.VBox()
            self._palette_box.pack_start(self._primary_box, False, True, 0)
            self._palette_box.pack_start(self._secondary_box, True, True, 0)

            self._widget.add(self._palette_box)
            self._palette_box.show()
            height = style.GRID_CELL_SIZE - 2 * self._widget.get_border_width()
            self._primary_box.set_size_request(-1, height)

        if self._content.get_children():
            self._content.remove(self._content.get_children()[0])

        if widget is not None:
            widget.connect('button-release-event',
                           self.__widget_button_release_cb)
            self._content.add(widget)
            self._content.show()
        else:
            self._content.hide()

        self._content_widget = widget

        self._update_accept_focus()
        self._update_separators()
    def __init__(self, **kwargs):
        PaletteWindow.__init__(self, **kwargs)
        self._has_focus = False

        group = palettegroup.get_group('default')
        group.connect('popdown', self.__group_popdown_cb)
        self.set_group_id('toolbarbox')

        self._widget = _PaletteWindowWidget()
        self._widget.set_border_width(0)
        self._setup_widget()

        self._widget.connect('realize', self._realize_cb)
    def __init__(self, **kwargs):
        PaletteWindow.__init__(self, **kwargs)
        self._has_focus = False

        group = palettegroup.get_group('default')
        group.connect('popdown', self.__group_popdown_cb)
        self.set_group_id('toolbarbox')

        self._widget = _PaletteWindowWidget()
        self._widget.set_border_width(0)
        self._setup_widget()

        self._widget.connect('realize', self._realize_cb)
    def __init__(self, **kwargs):
        PaletteWindow.__init__(self, **kwargs)
        self._has_focus = False

        group = palettegroup.get_group("default")
        group.connect("popdown", self.__group_popdown_cb)
        self.set_group_id("toolbarbox")

        self._widget = _PaletteWindowWidget()
        self._widget.set_border_width(0)
        self._setup_widget()

        self._widget.connect("realize", self._realize_cb)