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

Reply via email to