Menus Driving Me Nuts!

Peter Reid preid at reidit.co.uk
Mon Jun 27 13:18:31 EDT 2005


Well I've spent about 4 hours trying to get consistent cross-platform 
behaviour for two small projects without success!  I've looked 
through the lists for help about menus and tried various suggestions 
but without success.

I have a simple menu structure with a "File Edit Help" menu bar.  All 
I want is the following:

1) in the development environment on my Mac (OS X 10.3.9, Rev 2.6 
build 108), I want to see proper Mac menus (at the top of the screen) 
with my stack window showing just the objects I expect and no sliding 
or cropping and no blank space at the top where a Win menu bar would 
be displayed

2) in the standalone Mac app, I expect the same as above

3) in the standalone Win app, I expect the normal Windows behaviour, 
i.e. the window is slightly higher with the menu bar at the top and 
the remaining objects slid down the screen to accommodate it

It seems that instead of the above I can get the following, depending 
on what tricks I try:

a) standalone Mac app is fine but standalone Win app has no menu bar

b) standalone Win app is fine but standalone Mac app has lost the 
bottom of its window

c) standalone Win app is fine but standalone Mac app has Win-sized 
window with a blank space at the top where the menu bar would be and 
everything else moved down

The only way I've had some limited success is if I explicitly fix the 
window height in my preOpenStack handler.  Not only is this yuk, it's 
not fully reliable either!
I have tried completely removing and remaking the menus (several 
times), but nothing works consistently.

Also, how come both Mac and Win apps end up with a 'Quit' option in 
the File menu when the Win standard is 'Exit'?  Of course I can fix 
this with code, but why should I have to, surely you should be able 
to expect standard behaviour for each platform?

In the end I got most of what I want using the following script 
inside my preOpenStack handler (not nice or obvious but it does 
work!):

   if the platform is "MacOS" then
     if the environment is not "development" then
       put the height of this stack into theHeight
       set the editMenu of this stack to false
       show group menuBarName
       set the height of this stack to theHeight + the height of group 
menuBarName
     end if
   else
     set the editMenu of this stack to false
     put the height of this stack into theHeight
     show group menuBarName
     set the height of this stack to theHeight + the height of group menuBarName
   end if

I really can't believe how unreliable and torturous it is trying to 
get standard cross-platform menus.  Every time I start a new "short 
project", I spend more time trying to sort out the menus than I do 
completing the rest of the project!  It's now got to the point where 
I'm considering "jumping ship" to REALbasic for small projects has 
I'm so fed up with this fight every time - it's making small projects 
uneconomical with Rev.

Please can someone tell me how to get some reliable sanity into the 
menu process!

Peter
-- 
Peter Reid
Reid-IT Limited, Loughborough, Leics., UK
E-mail: preid at reidit.co.uk



More information about the use-livecode mailing list