OSX Menu Mystery
J. Landman Gay
jacque at hyperactivesw.com
Fri Mar 11 23:48:45 EST 2005
On 3/11/05 3:17 PM, graham samuel wrote:
> The only reference I could find was in Topics/Menus, where there is a
> question:
>
> How do I respond to quitting an OS X application?
>
> In truth this does not cover the topic of menu items being moved around
> automagically without the developer really being able to intervene, so
> we need a new topic - which perhaps contains the existing one - called
> something like:
>
> How do I make sure my menus operate correctly under OSX?
It was well-explained in the old docs, but in the transition to the new
format it seems to have got lost. Do you have a copy of Rev pre-2.5?
Look up "About...menus and the menu bar"; what you want is about 3/4 of
the way down the page. The article is a comprehensive explanation of all
things menu-related.
Here is a lengthy excerpt of the relevant portion:
--- Start documentation -----
Special menu items
A few menu items on Mac OS and OS X are handled directly by the
operating system. To accommodate these special menu items while allowing
you to create a fully cross-platform menu bar, Revolution treats the
last two menu items of the Help menu (for Mac OS and OS X), the File
menu (OS X), and the Edit menu (OS X) differently.
By following these guidelines, you can make sure your menus will appear
properly on all operating systems without having to write special code
or create platform-specific menu bars.
The Help menu and the "About This Application" menu item:
When Revolution sets up the Mac OS menu bar, it automatically makes the
last button the Help menu (regardless of the button's name). The
standard Help menu items, such as "About Balloon Help" and "Show
Balloons" on Mac OS, are included for you automatically; you don't need
to include them in your Help menu button, and you can't eliminate them
from the Help menu.
Revolution moves the last menu item in the Help menu to the "About This
Application" position. (On Mac OS systems, this is the first menu item
in the Apple menu. On OS X systems, it's the first menu item in the
Application menu.) Therefore, the last menu item in your Help menu
button should be an appropriate "About" item. The menu item above it
must be a divider line (a dash), and above that must be at least one
menu item to be placed in the Help menu.
The File menu and the "Quit" menu item:
On OS X systems, the "Quit" menu item is normally placed in the
Application menu (which is maintained by the operating system) rather
than in the File menu as is standard on other platforms. To acccommodate
this user-interface standard, Revolution removes the last two menu items
of the File menu when a standalone application is running on an OS X
system. Therefore, the last menu item in your File menu button should be
"Quit". The menu item above it should be a divider line (a dash).
The Edit menu and the "Preferences" menu item:
On OS X systems, the "Preferences" menu item is also normally placed in
the Application menu. To acccommodate this user-interface standard,
Revolution removes the last two menu items of the Edit menu when a
standalone application is running on an OS X system. Therefore, the last
menu item in your Edit menu button should be "Preferences". The menu
item above it should be a divider line (a dash).
Note: The Preferences menu item is treated in this special way only
if its name starts with the string "Preferences".
Tip: If your application's user interface is presented in a language
other than English, set the name of the Edit menu button to "Edit", and
set its label to the correct translation. This ensures that the engine
can find the Edit menu, while making sure that the menu is shown in the
correct language.
Choosing the special menu items:
When the user chooses any of these special menu items, a menuPick
message is sent to the button that the menu item is contained in. This
ensures that your button scripts will work on all platforms, even if
Revolution displays a menu item in a different menu to comply with
user-interface guidelines.
For example, if the user chooses "About This Application" from the Apple
menu on a Mac OS system, a menuPick message is sent to the Help menu
button, with "About This Application" as its parameter. You handle the
message for the About menu item in the Help menu button's script, even
though Revolution displays this menu item in a different menu on the Mac.
---- End documentation ----
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list