Re: [Rhythmbox-devel] "How do I detect when a user has changed a source?"



Hi David,

On Mon, Sep 10, 2012 at 6:56 AM, David Mohammed <davidmohammed gmail com> wrote:
> I'm attempting to write a GTK3 Rhythmbox 2.9x python plugin to browse albums
> by their cover-art.
>
> https://github.com/fossfreedom/coverart-browser
>
> In this plugin, I've added a widget to MAIN_TOP - but I only want to display
> this on the main library_source.
>
> At the moment - if the user clicks another source (for example the
> queue_source) - the widget remains visible.
>
> Is there a signal/event I can tap into to detect when a user has clicked to
> any particular source so that I can code whether the widget is visible or
> not?

Probably the best way to do this is to use notify::selected on the
source you're interested in. The 'selected' property is true when the
source is visible, false otherwise.

Since the source object is also the widget container, you could also
pack your widgets directly into the source and avoid the whole
problem, but that may bring other problems with it.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]