I was trying to write a method for adding Glyphs (control, option,
shift) to menu items. I found that Shift is 5 and 7 is Option. I
haven't found Control yet, and for some reason the Declare doesn't work.
If you try "SetMenuItemKeyGlyph(xMenu, Item, 5)", it sets the key
combination to "Command-Shift", dropping the key and putting them in
the wrong order (command should always be last).
Sub SetMenuItemGlyphs(Menu as Integer, Item as Integer, Control as
Boolean, Option as Boolean, Shift as Boolean)
Declare Function GetMenuHandle Lib "CarbonLib" ( menuID as Integer )
as Integer
Declare Function SetMenuItemKeyGlyph Lib "CarbonLib" (inMenu as
Integer, inItem as Integer, inGlyph as Integer) as Integer
Dim xMenu, glyphValue, error as Integer
xMenu = GetMenuHandle(Menu)
// Insert code for calculating glyphValue
error = SetMenuItemKeyGlyph(xMenu, Item, glyphValue)
End Sub
Any suggestions? :)
Regards,
Ryan Govostes
---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>
Unsubscribe:
<mailto:realbasic-nug-off at lists dot realsoftware dot com>
Subscribe to the digest:
<mailto:realbasic-nug-digest at lists dot realsoftware dot com>
.
|