menu preferences menuID, itemID
command, used in conjuction with other menu statements, moves the
preference item to the standard MacOS X location in the Application menu.
Prior to calling the menu preference statement, a menu must be
created with the preference item. When the menu preference statement
executes, it not only moves the preference item to the Application menu
but removes the preference item from the menu where it was created (
which is traditionally the edit menu but it could be a different menu
). When the preference
item is selected during program execution, the menu choice is converted
to the specified
itemID for use by the program. See the example below.
to OSX, the preference menu item was located at the bottom of the Edit menu. In OSX, the preference menu item is located in the application menu. The Menu Preference statement was created to reduce coding and allow FutureBasic programmers to use the same menus in OS 9 and MacOS X without changing their FutureBasic source code.
itemID must be the last item of the edit menu ( or wherever the preferences item is created ).
This command assumes menus are created programmatically using
either FB's Menu statement or toolbox calls. A menu bar and
menus created as a Nib with Apple's Interface Builder does not
need a Menu Preferences statement because the preference menu item is
in the nib.
if ( menu
== 2 and menu
Pref item selected
apple menu "About MyApp"
menu 1, 0, _enable,"File"
// Create Edit menu with standard copy, paste etc.
menu 2, 10, _enable,"Preferences/," // Create Preference as item #10 to make sure it is last on the edit menu
// Move item #10 from menu #2 ( preference item ) to
the application menu
on menu fn
( gFBQuit )
put preferences; get preferences; kill preferences