Menubar Handling

Mark Schonewille europe at ehug.info
Thu Mar 2 21:03:31 EST 2006


Hi Karen,

It seems you haven't got a repy to your question, yet. In the 
menubar script (or the script of the group that serves as 
menubar), you could put a menuPick handler. Have a look at the 
docs for info about the menuPick handler.

The menuPick handler could call scripts in the main stack or 
send commands to other stacks and objects. Depending on what you 
are trying to do, your menuPick handler might look like

on menuPick theMenuItem
   switch theMenuItem
     case "Open..."
       runOpenHandlerInMainStack
     break
     case "Something Else"
       send "runSomeHandlerInSubstack" to the topstack
     break
   end switch
end menuPick

The second "case" will work fine, if the main stack also has a 
"something" handlers. It would be easiest to put all scripts in 
the main stack, without using the "send" command, but if each of 
  your substacks should act differently upon a user's menu 
selection, "send" is a very useful command.

Best,

Mark


Karen wrote:
> Hi,
> 
> I'm trying to set up a Menubar for OS X with Revolution and I had  seen 
> mention of the idea of using a separate stack with a menubar (to  avoid 
> the stack contents moving around every time I load it).  I have  set 
> this up, and on the preOpenStack script of the other cards, I do:
> 
> set the menubar of me to "MyMenubar".
> 
> This seems to work very nicely - the other cards have the correct  
> menubar, but what I can't puzzle out is how to process the menu  actions 
> in these cards.  If I do nothing, they are processed back in  the 
> Menubar stack - which doesn't have the controls that I want to  refer 
> to.  How can I process the menu actions correctly?
> 
> Thanks,
> 
> Karen
>

-- 

Consultant and Software Engineer
mailto:m.schonewille at economy-x-talk.com
http://www.economy-x-talk.com

eHUG coordinator
mailto:europe at ehug.info
http://www.ehug.info

Advertise with us and reach 1000 truely interested internet 
users every month. See http://economy-x-talk.com/advertise.html 
for more information.




More information about the use-livecode mailing list