Pyjama comes with an own simple event interface.
It basically holds four methods which make it quite easy to react on events or create own events:
- pyjama.Events.add_event(EVENT_NAME)
- Creates an event called EVENT_NAME
- pyjama.Events.connect_event(EVENT_NAME, CALLBACK_FUNCTION)
- Connects to the event EVENT_NAME and calles CALLBACK_FUNCTION whenever this event is raised
- pyjama.Events.raise_event(EVENT_NAME, *ARGS)
- Raises the event EVENT_NAME with the params *ARGS
- pyjama.Events.disconnect_event(EVENT_NAME, CALLBACK_FUNCTION)
- Disconnects CALLBACK_FUNCTION from the event EVENT_NAME
Please notice that some events (e.g. 'pluginloaded') send some additional params to the callback function. In order to prevent errors please check, if your callback function takes these params.
Eventlist: The following events might interest you:
- pluginloaded
- nowplaying
- alldone
- showing_album_page
- showing_artist_page
- firstrun
- error
- layout_changed
- populate_listmenu
- popular_playlistmenu
- scrolled_window_resized
- playlist_tooltip
For more information have a look at the clEvent module.