Re: [Rhythmbox-devel] How to access RB.LibraryBrowser from Python



On Sat, Jan 5, 2013 at 8:47 AM, Donagh Horgan <donagh horgan gmail com> wrote:
Hi all,

I've been reading the unofficial Rhythmbox 2.97 Python documentation here, but I'm a bit stumped on how to access the output-model property of the RB.LibraryBrowser from the shell (assuming that it's actually possible in the first place)? You might need to do this, for example, if you wanted to manually update an RB.EntryView for a source based on some selections made in the RB.LibraryBrowser of that source.

Sources based on RB.BrowserSource use the output model of the browser as the source query model, so you can get at it using source.props.query_model. The browser is an implementation detail of the source, and you generally shouldn't need to do anything to it, though.  What do you intend to do to the entry view, and why do you need the model to do that?
 
The documentation mentions a notify signal for the output-model property, but I've no idea how to connect to this either (or whether the callback comes with the query model I'm after).

Whenever a property on a GObject changes, it emits a signal named "notify", with the property name as the signal detail. So, for the output-model property on a browser object, you'd do browser.connect("notify::output-model", callback).



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