[Rhythmbox-devel] gtk.ToggleToolButton in Rhythmbox Toolbar?
- From: Jannik Heller <scrawl baseoftrash de>
- To: rhythmbox-devel gnome org
- Subject: [Rhythmbox-devel] gtk.ToggleToolButton in Rhythmbox Toolbar?
- Date: Tue, 01 Dec 2009 22:37:01 +0100
Hi,
in my Python plugin, I want to add a ToggleToolButton to the Rhythmbox
toolbar, like in the visual effects plugin. Unfortunately its written in
C and i don't understand the source code. I use the following code to
add a gtk.ToolButton to the Toolbar:
ui_str = """
<toolbar name="ToolBar">
<placeholder name="PluginPlaceholder">
<toolitem name="RecordStationManager" action="RecordManager"/>
</placeholder>
</toolbar>
</ui>
"""
self.action_manager = gtk.Action('RecordManager', _('Record Manager'),
_('Show the record manager'), 'record-station')
self.activate_id_manager = self.action_manager.connect('activate',
self.manage_dialog, shell)
self.action_group = gtk.ActionGroup('RecordStationPluginActions')
self.action_group.add_action(self.action_manager)
uim = shell.get_ui_manager ()
uim.insert_action_group(self.action_group, 0)
self.ui_id = uim.add_ui_from_string(ui_str)
self.btn_manager=uim.get_widget('/ui/ToolBar/PluginPlaceholder/RecordStationManager')
self.btn_manager.set_stock_id("gtk-connect")
self.btn_manager.set_label(_('Record Manager'))
uim.ensure_update()
So how do I do a ToggleToolButton?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]