"Robert Rozman" wrote:
> Hi,
>
> well when I press return on speak1 I don't go into new menu with two choices
> but instead both choices are executed twice and then get error that "no
> action defined for this choice".
>
> MY intention is to get into new menu with two choices that could then be
> executed, but as already mentioned they are executed prior that...

Ah, I see

    def actions(self):
        """
        return a list of actions for this item
        """
        items = [ ( self.run("on") , _('Run TINIA Command On') ),
                ( self.run("off") , _('Run TINIA Command Off') ) ]
        return items


The problem is, that you call self.run while build the actions. Action
should return a function, not call it. So you have two choices:

a. wrap self.run with the two parameter, because you can't give an arg
   in actions:

        items = [ ( self.run_on , _('Run TINIA Command On') ),
                  ( self.run_off , _('Run TINIA Command Off') ) ]

             
   and later def run_on(...):
                 self.run('on')


b. add a MenuItem instead of the list:

        items = [ MenuItem('Run On', self.run, 'on' ...),
                  MenuItem('Run Off', self.run, 'off' ...) ]
   
   see menu.py MenuItem for the exact parameter, I'm just guessing. 



> Thanks in advance,

HTH


Dischi

-- 
A marriage is always made up of two people who are prepared to swear that
only the other one snores.
        -- (Terry Pratchett, The Fifth Elephant)


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to