l i v e c o d e

How to Add Menus Without the Stack Resizing
Mac OS 9 Mac OS X Windows Windows

> I am still having the problem where the bottom of a stack gets cut off
> on Mac standalone builds when the stack contains a menu bar. This has
> been going on forever and usually (but not always) can be fixed by
> setting the desired stack height in a preopenstack handler.
>
> Since I don't see many complaints about this behavior, I'm wondering if
> others are still seeing it or if it is just me. If it is just me, does
> anyone know what causes it? I'd very much like to avoid using the
> work-around hack if possible.

For those of you who've come lately to this, the problem was simple. How to add menus for both Mac and PC to an existing stack *without* ever resizing the existing stack.

As you all probably know, the minute you add a menu to a stack, its height is recalculated whenever it opens on a different platform. The reason is that the menubar is 'on the card' for the PC, but at the top of the screen for the Mac. So, when viewing the stack on the Mac, the stack is automatically reduced in height by the amount of the menubar (thus screwing up my carefully rendered screen layout ;-).

bummer, especially if you don't want this behavior.

So, Richard's idea was pretty straightforward:
  1. set the editmenu property of the stack to true
  2. hide the menu group
So, here's how it works: When the stack is opened up on the Mac, because the editmenu prop is true, the menus appear at the top of the card and not in the menubar. But a little known fact (only Richard knows it apparently as it's not documented) is that the menus will appear in the menubar if the menuGrp is hidden! So, just hide the group and then show it if the platform is Win32.

Works like a charm...and no resizing of the stack whatsoever.

Cool, and thanks, Richard!

Posted on 4/4/05 by Chipp Walters to the Use Revolution list


 Print this tip

News and Rumors Products Services Developer Resources Contact STS About STS