Menu bars on main stack and different menus on substacks

Martin Koob mkoob at rogers.com
Thu Jan 1 20:20:56 EST 2009


Richard Gaskin <ambassador at ...> writes:


> Being the lazy person I am, I wonder what the downside would be to just 
> leave the two sub-menu items in place across all the cards.  But I also 
> recognize that I have no idea what the app does, so that may not be a 
> suitable option. :)
> 
> If not, one approach I've used for menu updating is to store a list of 
> items in a custom prop, and on mouseDown in the menu group I populate 
> the menu buttons, adding, deleting, or modifying items as needed.  With 
> Rev 2.7 forward the mousedown message is sent to a menu group even when 
> using a keyboard menu shortcut, and even with the mouse it completes 
> processing before the menu is displayed, so one mouseDown handler lets 
> me handle all menu updates gracefully.
> 
> This might seem that it would be slow, but the engine is amazingly fast 
> with this sort of thing; I doubt you'd ever notice any impairment in 
> responsiveness.
> 

Part of my rationale for changing the menus on the new card is also
laziness on my part.   I don't want to change the documentation for the
existing card.  It is also partly that I am trying to keep the menus as
simple as possible for users by removing items that won't ever apply
(and therefore be enabled) in that card.

Thanks for your suggestion.  I have tried successfully to change the
items of the menu as you suggested using the following line of code.

   set the text  of button "File" to  the menuset2 of button "File"


However, I was wondering how I could add or remove a full menu not just
change the items ie.

MainMenuBar

File    Edit    Help

SecondMenuBar

File    Edit   Project   Help

This would be another use of changing the MenuBar with 'set the Menubar
of stack'  in order to create contextual menus as William Humphrey
mentioned. The problems with the stack height changing and the menu
button appearing would have to be managed.  Is there another way to do
this?

Martin








More information about the use-livecode mailing list