Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Q] Getting keyboard font in a menu item

0 views
Skip to first unread message

David Phillip Oster

unread,
Nov 14, 1998, 3:00:00 AM11/14/98
to
I'm trying to get an arrow key to appear in an OS menu item. (I'm trying
to make my program more self documenting by having menu items that do the
same thing as the arrow keys, with the arrow key in the menu item, so the
user can see, by looking at the menu bar, what the key does.)

When I look at:

(URL 1)
http://developer.apple.com/techpubs/mac/MacOS8ToolboxRef/ToolboxRef-250.html

it documents the glyphs in the keyboard font, and the 'xmnu' resource that
you use for defining the new menus.

I failed at trying to do this using resources. (Although I was able to use
an 'xmnu' to add a 'forward-delete key' symbol, both with and without a
'command' symbol to a menu. (You know, the key under the 'help' key, just
above the 'left arrow'.)

Since I failed with an 'xmnu' I thought I'd try it using system calls.

I know that SetMenuItemFontID() is the wrong call: it sets the font of the
entire menu item, not just of the key equivalent.

I tried SetMenuItemKeyGlyph(), documented on:

(URL 2)
http://developer.apple.com/techpubs/mac/MacOS8ToolboxRef/ToolboxRef-275.html

using the keycodes given in (URL 1) of this message, but it just draws:
Home <Command>e

i.e., the command symbol shows, and the 'e' is in the ordinary menu font,
not the keyboard font as the documentation in (URL 1) leads me to expect.

How do you make this work?
Does it work differently in 8.1 than 8.5?

James W. Walker

unread,
Nov 14, 1998, 3:00:00 AM11/14/98
to
In article <oster-14119...@10.0.2.15>, os...@netcom.com (David
Phillip Oster) wrote:

>I'm trying to get an arrow key to appear in an OS menu item. (I'm trying
>to make my program more self documenting by having menu items that do the
>same thing as the arrow keys, with the arrow key in the menu item, so the
>user can see, by looking at the menu bar, what the key does.)

<snip>

>Does it work differently in 8.1 than 8.5?

As far as I can tell, substitute key glyphs don't work under 8.1 (they use
the system font rather than the keyboard font) but do work under 8.5.

I notice that the sample program that came with the Appearance SDK
illustrated the use of multiple modifier keys, but not substitute key
glyphs. Maybe they already knew it didn't work.
--
Jim Walker <http://members.aol.com/jwwalker/>
To reply, take out the spam-blocker from my address.

0 new messages