realbasic-nug
[Top] [All Lists]

Menu Glyphs?

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Menu Glyphs?
From: Ryan Govostes <panic at twcny dot rr dot com>
Date: Sun, 30 Mar 2003 16:43:54 -0500
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>
.


<Prev in Thread] Current Thread [Next in Thread>