"Set as Menu Bar on Mac OS" oddities
J. Landman Gay
jacque at hyperactivesw.com
Sat Jun 11 21:39:55 EDT 2011
On 6/11/11 3:36 PM, stephenmcnutt wrote:
> It's over three years later, and this apparently hasn't been fixed. Granted,
> I'm using LiveCode 4.5.3 and not the very latest version, so if it has been
> fixed, I'd like to know and would consider upgrading.
I've learned to work with it, though I do wish it were fixed. There's a
conflict if you have destroystack set to true; if you don't set that
property then chances are the problem will go away.
But there are a few tricks to get around the bug anyway.
>> It seems that if
>> Revolution is going to scale and scroll the window to hide the menu bar
>> on the mac, it ought to adjust the minHeight along with that. I can't
>> imagine a scenario where the minHeight shouldn't change by 22 pixels
>> when a non-adjustable strip of UI elements is added/removed from a
Set the minHeight while "Set as Menu Bar on Mac OS" is turned on and it
will always be accurate on any platform. This is the only time during
development you should have that checkbox ticked.
>> With "Set as Menu Bar on Mac OS" still checked and running in a stand
>> alone on OS X, there are apparently now 22 extra pixels at the bottom
>> of the stack that are not accounted for- i.e. getting the height of the
>> stack reports 22 pixels less than what's actually there.
Always use the card height, not the stack height. The stack height is
equivalent to the window height, which will indeed be shorter on a Mac
when there's a menu bar (because the card has scrolled up so the window
is shorter.) The card height is always stable, even though the top few
pixels may not be showing.
>> I started out not having "Set as Menu Bar on Mac OS" checked.
>> I was using the following to show/hide the menu bar:
>> on preOpenStack
>> if the short name of this stack is the mainStack of this stack then
>> if the platform is "MacOS" and the environment is not "development"
>> set the defaultMenubar to "Menubar 1"
>> hide group "Menubar 1"
>> show group "Menubar 1"
>> end if
>> end if
>> end preOpenStack
>> Then, I had code to loop through my fields& buttons and scoot them all
>> up 22 pixels.
The size of the window will change if you toggle the menubar property,
so don't do that. If you want to hide the menubar, just use "hide
menubar". Don't change the window size by removing the menubar entirely.
Set the editMenus to true during development (turn off "show as menubar"
on a Mac) and place your objects that way. In fact, during development,
always leave the menubar as a visible group at the top. Don't set it as
the system menu bar until you are all done with the stack. In fact, I
leave it as a group all the time and I build for both Windows and Mac
without any menubar set. Then in a preOpenStack handler I do this:
if the platform is MacOS then
set the menubar of this stack to "myMenuBar"
That way the standalone builder is happy, controls all pop into place
correctly, there's no extra space or truncated space when the stack
starts, and basically all is well.
You could try just turning off destroystack though, and the problem may
not happen at all.
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the Use-livecode