button next to shuffle

Oliver Marks <[email protected]>
Newsgroups gmane.comp.gnome.apps.rhythmbox.devel
Message-ID <CACvA_Fd3uKDMOk_jCnZuBXv=PUq44E4cc-+6Kx62_YuSz3b+=w@mail.gmail.com>
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="ViewWebRemoteInfo"/>
        </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 = Gtk.Action('ViewWebRemoteInfo','test','test','')
        #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)

_______________________________________________
rhythmbox-devel mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/rhythmbox-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.