Shrinking Mac stack

Richard Gaskin ambassador at fourthworld.com
Thu Apr 14 21:37:10 EDT 2005


Sarah Reichelt wrote:
>> 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, it's 
>> 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:
>>
>> set the editmenu property of the stack to true
>> 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.
>>
> Has anyone got this to work on Rev 2.5.1?
> 
> When I try it, I get what you would expect - no menus because they are 
> invisible, which is a shame because it is a very neat way around this 
> problem which is driving me nuts at the moment.
> I'm trying to do some resizing on a stack and I'd swear that the loc and 
> rect of objects vary according to whether you are getting or setting 
> them - but this is probably me just being paranoid :-)

Soem day I'll write a tutorial stack on working with menu oddities -- I 
seem to be the only one who loves the way menus work in Rev.

The only difference I've seen in coordinates is between stack height and 
card height -- the card height will be taller if the menu group is 
cropped out of view.

When all else fails, I find that simply emptying the stack's menuGroup 
property and then entering it fresh lets the stack update itself for 
consistent performance from that point forward.

--
  Richard Gaskin
  Fourth World Media Corporation
  __________________________________________________
  Rev tools and more: http://www.fourthworld.com/rev


More information about the use-livecode mailing list