[EMAIL PROTECTED] wrote:
> Hi,
>
> i am currently trying to write a small plugin, but i am stuck on the
> event handling.
> I create the MainMenuPlugin staff:
>
> class PluginInterface(plugin.MainMenuPlugin):
>         def items(self, parent):
>                 item = VolumeMainMenuItem()
>                 item.name = "Volume"
>                 item.parent = parent
>                 return [ item ]
>
> Then, in class VolumeMainMenuItem() i want to have the eventhandler.
> I tried it this way:
>
> class VolumeMainMenuItem(Item):
>
>         def actions(self):
>                 items = [ (self.create_menu, 'Volume') ]
>                 return items
>         
>         def create_menu(self, arg=None, menuw=None):
>                 items = [ menu.MenuItem('blablubb')  ]
>                 mymenu = menu.Menu(('Volume'), items,  
> reload_func=menuwidget.goto_main_menu)
>                 menuw_backup = menuw
> #                menuw.hide()
>                 menuwidget.pushmenu(mymenu)
>                 menuwidget.refresh()
>
>         def eventhandler(self, event=None, menuw=None, arg=None):
>
>                 print "eventhandler2"
>                 if event == em.INPUT_LEFT:
>                         print "left"
>                         system("aumix -v -10")
>                         system("aumix -v q")
>                         return 1
> [...]
>
> but unfortunately it won't get the events.

You should get the events as soon as you select the item with the menu
and an event is passed into the Freevo event system (e.g. pressing a
key). 

> Clearly, i missed something important, how freevo handles its events.
> I looked at some other plugins but i can't get, what i am doing wrong.
>
> It would be very nice , if someone can push me in the right direction.

HTH, if not, ask again (or wait for my Plugin HOWTO)


Dischi

-- 
All wiyht. Rho sritched mg kegtops awound?


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to