Stack Menu Mystery - Disappointing Documentation (Long, sorry)

Richard Gaskin ambassador at fourthworld.com
Tue Nov 25 11:06:14 EST 2014


Bob Sneidar wrote:

 > There is a checkbox in the menu builder called Set as Stack Menu bar.
 > I’m wondering if that is what everyone means by a stack menu?

Stack menus are far more primitive than that, going back to the very 
early days of MetaCard in which making a menu meant laying out buttons 
with a very specific mix of property settings to appear and behave like 
a menu, and then either calling that stack with a popup command or 
assigning it as the menuName property of a button.

This was super-tedious, and when trying to get proper appearances for 
both Linux and Windows very difficult, and impossible for Mac given its 
global menu bar.

So as the engine was ported to Mac, the need to support the Mac's global 
menu bar prompted the creation of a subclass of buttons which allow us 
to have menu items defined as simple text strings - much easier to work 
with, and much more HIG-compliant.

Interestingly, on Windows and Linux menus are still rendered as stacks, 
but done by the engine.  This is much faster and more attractive than 
the olden days when we used to make them by hand, but obviates some 
opportunities to make menus in closer compliance to those HIGs.

This is rarely evident to us (the implementation is pretty good), but if 
you happen to check "the windows" while a menu is open you'll find that 
the first line of the list returned from that function is blank - that's 
the name of the menu stack that is the open menu.  In some routines I 
rely on that to know when a menu is open - not often needed, but can be 
useful to know.

When Theming becomes available we'll be able to revamp the ways menus 
are constructed, mapping those calls to native OS routines for even 
closer adherence to user expectations.   And along with that I'll 
probably need to come up with another way to know if a menu is open 
since I won't be able to rely on the first line of "the windows" being 
blank - small price to pay if we finally get automatically-toggling Alt 
key shortcuts for Windows.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list