gmusicbrowser Forum

Main board => Questions => Topic started by: trasdahl on March 21, 2011, 15:45:40

Title: Set filter from custom widget
Post by: trasdahl on March 21, 2011, 15:45:40
Is there a command that would allow me to set a filter from any layout item through a click1-action? I would like to be able to write something like

"Artist(click1=SelectArtist(%a))"

or

"Album(click1=SetFilter(artist,%a))"

or maybe something with a generic Button. Is it possible? Maybe through a "RunPerlCode"-command?

Title: Re: Set filter from custom widget
Post by: Quentin Sculo on March 29, 2011, 23:07:12
Sorry to reply so late.
There is no command to do that yet, though it is planned.
It is, of course, possible to do with the RunPerlCode command, though it is a bit complicated, and I plan to make some changes to the internal filter syntax very soon...
But as a less generic command :
RunPerlCode(::Select( filter => Songs::MakeFilterFromID(artist=>$::SongID) ))
will set the filter to "songs from current artist", you can replace artist by album and a few others.