Thanks for the info, 3 dummy functions solved my problem and the plugin
works. I will post it to the list when it's ready.

However, I've changed my mind. I want the three menu items to appear in
the Image section of freevo (not when ENTER a directory as now). I
looked at the webradio-plugin (which shows up in music section) but did
not figure out how to write it. Would it be hard to implement that? It
looks a bit complicated when looking at the webradio plugin.

/Bjorn

 --- Dirk Meyer <[EMAIL PROTECTED]> skrev: > Jortan wrote:
> > Hi,
> >
> > I'm writing a plugin where I want 3 menu items to appear when I
> ENTER a
> > directory. Each of these items will, when selected, call the same
> > function but with different argument. How do I code that? 
> 
> You write an ItemPlugin. You put it into src/plugins if it's not a
> special plugin for video or audio. The ItemPlugin needs a function
> actions() to return a list of possible actions. This function get's
> the item, check for 'if item.type == 'directory':' and return [] if
> not (since you only want dirs). An action can be a list of callback
> and name or a menuitem (from menu.py). The first as no arguments, but
> you can create a dummy function:
> 
> def realfunction(self, parameter):
>     do stuff
> 
> def call_with_arg_1(self, menuw=menuw, arg=arg):
>     self.realfunction('foo')
> 
> ...
> 
> If you use MenuItem, you can also set an argument. See file_ops.py
> for
> an example.
> 
> > I'm at work and do not have any code example, sorry. 
> >
> > Thanks in advance
> 
> If you need more info, please ask. And if you plugin does something
> usefull to other people, please send it to the list when you've done
> it. 
> 
> 
> Dischi
> 
> -- 
> "Es gibt 10 Arten von Menschen die Bin�r verstehen,
> diejenigen die es tun, und diejenigen die es nicht tun."
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> SourceForge.net hosts over 70,000 Open Source Projects.
> See the people who have HELPED US provide better services:
> Click here: http://sourceforge.net/supporters.php
> _______________________________________________
> Freevo-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/freevo-users 

H�strusk och gr� moln - k�p en resa till solen p� Yahoo! Resor p� adressen 
http://se.docs.yahoo.com/travel/index.html


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Freevo-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to