[Rhythmbox-devel] button next to shuffle
- From: Oliver Marks <oly digitaloctave com>
- To: rhythmbox-devel gnome org
- Subject: [Rhythmbox-devel] button next to shuffle
- Date: Thu, 12 Jul 2012 08:41:56 +0100
Hi,
I have written a plugin for rhythmbox which is working nicely however i have need to add a button to the main toolbar ie next to the shuffle button in the top icon bar.
I have tried shell.add_widget(button,RB.ShellUILocation.MAIN_TOP) which adds a button but its displayed after the progress bar which is not ideal.
I have also tried using add_ui_from_string with code like below, however with this method i am probably doing something wrong, ideally i would prefer the first method as its much simpler to use standard gtk function, but regardless anyone able to give me some pointers example code etc to achieve what i am after ?
ui_definition = """
<ui>
<toolbar name="ToolBar">
<placeholder name="ToolBarPluginPlaceholder">
<toolitem name="ToolBarWebRemote" action="">
</placeholder>
</toolbar>
</ui>"""
uim = shell.props.ui_manager
self.__ui_id = uim.add_ui_from_string(ui_definition)
uim.ensure_update()
button=uim.get_widget('/ToolBar/ToolBarPluginPlaceholder/ToolBarWebRemote')
action = ""> #button=Gtk.Button('test')
#button.show()
#self.object.add_widget(button,RB.ShellUILocation.MAIN_TOP,expand=False, fill=False)
self.__action_group = Gtk.ActionGroup(name='ViewWebRemoteInfo')
self.__action_group.add_action(action)
uim.insert_action_group(self.__action_group, -1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]