Determining which menu button was clicked on Mac

Paolo Mazza mazzapaolo at libero.it
Tue Jan 13 11:01:20 EST 2004


I would set script of  the menubutton to :

on menuPick pWhich
   put the text of me into TESTO

   switch pWhich
   case (line 1 of TESTO)

     if line 1 of TESTO is "play" then
-- do something
       put "stop" into line 1 of TESTO
     else
       put "play" into line 1 of TESTO
-- do something
     end if
     set the text of me to TESTO	
     break
	
   case (line 2 of TESTO)
     beep 1
     break
   end switch

end menuPick

However it would be very useful to have  a "MenuPickNumber"  returned 
by Revolution any time a menu item (or a sub-menu item) has been 
clicked,
So, we could easily change the text of the button  and let the script 
unchanged (for example when we have a menu issued in different 
languages).

Best regards

Paolo Mazza



Giovedì, 8 Gen 2004, alle 06:40 Europe/Rome, Trevor DeVore ha scritto:

> On Jan 7, 2004, at 6:26 PM, Björnke von Gierke wrote:
>
>> I had a similar problem like you, where I wanted to check/unckeck a 
>> menu item before the menu is shown. And indeed I was unable to do 
>> this anywhere else then the menubar group's script on OS X. I worked 
>> around this by using a "if the target = "view" then" script. It might 
>> be time for a feature request?
>
> Where would you put the 'if the target = "view" then' script?  I tried 
> checking 'the target' in the menubar group script but it returned the 
> name of the menubar group rather than the name of the menu that was 
> selected.
>
> -- 
> Trevor DeVore
> Blue Mango Multimedia
> trevor at mangomultimedia.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list