On Sun, 2007-05-06 at 13:14 +0200, Jarek Zgoda wrote: > I was looking through sources of Python-based plugins for RB and I > didn't found any, that operates on selected entry (not "currently > playing"). How do I get selected entry? In PyGTK this is done usually > by using gtk.TreeSelection from tree_view.get_selection(), but I > cann't find any pointer to this TreeView.
Sources have a "entry view" which is the track list, an instance of the class rb.EntryView (which is derived from gtk.TreeView). You can get it with "view = source.get_entry_view()" and then use it like a normal TreeView. rb.EntryView has a method designed for getting the list of selected entries (remember, there may be more than one) - get_selected_entries(). So you can do things like: for entry in source.get_entry_view().get_selected_entries(): do_something (entry) Cheers, -- Unix Mercenary - We're not happy until you're not happy _______________________________________________ rhythmbox-devel mailing list rhythmbox-devel@gnome.org http://mail.gnome.org/mailman/listinfo/rhythmbox-devel