[futurebasic] Getting preferences item ID

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2005 : Group Archive : Group : All Groups

From: Bernie <fblist@...>
Date: Wed, 20 Apr 2005 16:06:34 +0100
I'm trying to determine the location (itemID) of the Preferences item 
in the Application Menu. Calling the following always returns an index 
value of 1

ignore = fn GetIndMenuItemWithCommandID(_nil, _kHICommandPreferences, 
1, menuRef, index)

Think I've got to assume that, in the Application menu, index is not 
the same as itemID. Anyone know how to convert index to itemID?

Bernie


'---------
local fn DoDialog
dim as MenuRef       @ theMenu
dim as MenuItemIndex @ index
dim as OSStatus        ignore

long if dialog(0) == _btnClick

ignore = fn GetIndMenuItemWithCommandID(_nil, _kHICommandAbout, 1, 
@theMenu, @index)
print %(3,20)"About:"index

ignore = fn GetIndMenuItemWithCommandID(_nil, _kHICommandPreferences, 
1, @theMenu, @index)
print "Preferences:"index

ignore = fn GetIndMenuItemWithCommandID(_nil, _kHICommandQuit, 1, 
@theMenu, @index)
print "Quit:"index

end if
end fn

EnableMenuCommand(0, _kHICommandPreferences)
window 1
button 1,,"Get ItemIDs",(40, 200)-(180, 220)

on dialog fn DoDialog

do
HandleEvents
until 0
'---------