MenuBar in Mac OS X
Martin Baxter
martin at harbourtown.co.uk
Mon Sep 8 02:53:00 EDT 2003
Dear Yves,
I too have a problem with this for a long time. Scott Raney doubts this is
a bug but I'm not convinced.
I only get this problem in *substacks* that have a menubar - never yet with
mainstacks - is your problem with a substack or a mainstack ?
First point, as you have discovered, you cannot fix this by resizing the
script in a preopenstack handler. The engine itself is busy resizing the
stack at that point and if your script tries to resize it as well it will
just make confusion.
I've found 2 ways to deal with it:
## 1) In my case it is only my substacks that are affected.
So if it is possible to make the problem stacks into separate mainstacks
(instead of being substacks), you may find the problem stops happening.
## or 2) (This is a bit more complicated but for some reason it seems to work)
In the substacks that have menubars I put this:
on savestackrequest
set the height of me to x
### (x = the wanted height in pixels)
pass savestackrequest
end savestackrequest
Then immediately before building the app I run this script (which is in a
utility stack that isn't part of the build)
# pre-build save, first open all
put the substacks of stack "themainstack" into sslist
repeat for each line i in sslist
if i is not in the windows then
open stack i
end if
end repeat
put the menustacklist of field "stacklist" of stack "utilitystack" into
data
# menustacklist is just a custom property that
# holds the names of the substacks that have menubars
if data is not empty then
repeat for each line i in data
save stack i
#( this runs the savestackrequest handler
# and sets the stacks height correctly)
end repeat
end if
# now save all the substacks
repeat for each line i in sslist
save stack i
end repeat
# now close all the substacks
repeat for each line i in sslist
close stack i
end repeat
put "Pre - Build Prep Done"
After this I close the mainstack by hand, quit, restart, and build
All of this is "empirical" rather than "scientific" But for me it works
reliably.
martin baxter
Yves COPPE wrote:
>To: Use Rev <use-revolution at lists.runrev.com>
>Reply-To: use-revolution at lists.runrev.com
>
>Hello list,
>
>Working on Mac OS X 10.2.6 FR with Rev 2.1
>
>I will ask something it has already been discussed before but I don't
>find a solution.
>
>I've made a simple stack with Rev 2.1. Metal decorations. Buid
>distribution.
>Good.
>
>Now i'd like to add a menuBar
>
>when I build the distribution app, and open my app afterwards, the
>stack's height is truncated of the height of the menubar's height.
>
>how can I retrieve my normal stack's height.
>I've tried :
>
>on preopenstack
>set the height of stack "xxx" to "yyy"
>end preopenstack
>
>but it doesn't work fine.
>
>Thanks.
>
>Greetings.
>Yves COPPE
>
>yvescoppe at skynet.be
More information about the use-livecode
mailing list