def _load_toolbar(self): toolbar = gtk.Toolbar() # Remove Feed Palette remove_button = ToolButton(icon_name='list-remove') vbox = gtk.VBox() label = gtk.Label(_('Really delete feed?')) vbox.pack_start(label) hbox = gtk.HBox() expander_label = gtk.Label(' ') hbox.pack_start(expander_label) #b = gtk.Button(icon_name='stock-remove') b = ToolButton(icon_name='list-remove') #b.set_use_stock(True) b.connect('clicked', self._on_remove_feed_activate) hbox.pack_start(b, False) vbox.pack_start(hbox) palette = Palette(_('Remove Feed?')) palette.set_content(vbox) vbox.show_all() remove_button.set_palette(palette) toolbar.insert(remove_button, -1) remove_button.show() # Add Feed Palette button = ToolButton(icon_name='list-add') toolbar.insert(button, -1) button.show() self._add_feed_dialog = AddFeedDialog.AddFeedDialog( gtk.glade.XML(os.path.join(self.glade_prefix, 'penguintv.glade'), "window_add_feed", 'penguintv'), self) #MAGIC content = self._add_feed_dialog.extract_content() content.show_all() #button.connect('clicked', self._add_feed_dialog.show) palette = Palette(_('Subscribe to Feed')) palette.set_content(content) button.set_palette(palette) self._feedlist = gtk.ListStore(int, str, str) self._combo = gtk.ComboBox(self._feedlist) cell = gtk.CellRendererText() self._combo.pack_start(cell, True) self._combo.add_attribute(cell, 'text', 1) self._combo.connect("changed", self._on_combo_select) toolcombo = ToolComboBox(self._combo) toolbar.insert(toolcombo, -1) toolcombo.show_all() toolbar.show() return toolbar
def _load_toolbar(self): toolbar = gtk.Toolbar() # Remove Feed Palette remove_button = ToolButton(icon_name='list-remove') vbox = gtk.VBox() label = gtk.Label(_('Really delete feed?')) vbox.pack_start(label) hbox = gtk.HBox() expander_label = gtk.Label(' ') hbox.pack_start(expander_label) #b = gtk.Button(icon_name='stock-remove') b = ToolButton(icon_name='list-remove') #b.set_use_stock(True) b.connect('clicked', self._on_remove_feed_activate) hbox.pack_start(b, False) vbox.pack_start(hbox) palette = Palette(_('Remove Feed?')) palette.set_content(vbox) vbox.show_all() remove_button.set_palette(palette) toolbar.insert(remove_button, -1) remove_button.show() # Add Feed Palette button = ToolButton(icon_name='list-add') toolbar.insert(button, -1) button.show() self._add_feed_dialog = AddFeedDialog.AddFeedDialog(gtk.glade.XML(os.path.join(self.glade_prefix, 'penguintv.glade'), "window_add_feed",'penguintv'), self) #MAGIC content = self._add_feed_dialog.extract_content() content.show_all() #button.connect('clicked', self._add_feed_dialog.show) palette = Palette(_('Subscribe to Feed')) palette.set_content(content) button.set_palette(palette) self._feedlist = gtk.ListStore(int, str, str) self._combo = gtk.ComboBox(self._feedlist) cell = gtk.CellRendererText() self._combo.pack_start(cell, True) self._combo.add_attribute(cell, 'text', 1) self._combo.connect("changed", self._on_combo_select) toolcombo = ToolComboBox(self._combo) toolbar.insert(toolcombo, -1) toolcombo.show_all() toolbar.show() return toolbar
test = common.TestPalette() palette = Palette('Test radio and toggle') test.set_palette(palette) box = gtk.HBox() toggle = gtk.ToggleButton() icon = Icon(icon_name='go-previous', icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR) toggle.set_image(icon) box.pack_start(toggle, False) toggle.show() radio = gtk.RadioButton() icon = Icon(icon_name='go-next', icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR) radio.set_image(icon) radio.set_mode(False) box.pack_start(radio, False) radio.show() palette.set_content(box) box.show() if __name__ == '__main__': common.main(test)