Bill Vlahos wrote:
Does anyone know if there are any consequences in using the "button" syntax instead of "menu"? Menu works fine on Mac and Windows so I don't want to break any of my existing code.

I tend to prefer using "button" over "menu", because it's more specific:

The option to use "menu" was added mostly for HC compatibility, and will affect whatever is the current menu bar. In HC of course there's only one menu bar and it's not associated with any physical object in your stack, so it works well enough to refer to 'menu "File"' and you always know you'll be dealing with just one thing.

But in Rev, menus are groups of menu buttons on a card, and the current menu can be one of two things: when a stack has its own menubar group defined it refers to a button in that group, but when a stack has no menubar of its own it refers to a button in whatever group is currently defined as "the default menubar".

In some cases the flexibility of using "menu" this way can be useful. You can write a single handler to modify menu contents regardless of whether its part of the stack that currently has focus or the default menubar.

But in other cases it can be troublesome, possibly altering IDE menus when you wanted to modify one of your own.

For this reason I tend to use "button" to refer to menus, requiring me to specify the button by its owner and therefore ensuring that I know exactly which object is being affected.

--
 Richard Gaskin
 Fourth World
 Revolution training and consulting: http://www.fourthworld.com
 Webzine for Rev developers: http://www.revjournal.com
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to