Re: Keyboard accelerators



Maciej> In many GUI systems, the first letters (or occasionally
Maciej> another in case of conflict) of menu items, pushbuttons, and
Maciej> the labels of all dialog controls are underlined, and you can
Maciej> simply hit some modifier key plus the letter (Meta would be a
Maciej> good choice for X) to push the button, activate the menu, or
Maciej> switch to the control.

Actually, Motif GUIs have two different key binding notions (I don't
know if Windows is the same, but I assume so because it shows both the
GUI elements below):

1. The underlined letter on a menu item is used when doing keyboard
menu traversal.  With Motif you can start keyboard menu traversal with
F10.

2. The accelerator is displayed to the right of the menu item's text,
and shows the key sequence that can be used anywhere in the window to
get that functionality.


That's for menus.  I've seen underlined letters on buttons in Windows,
but I don't know what they do.  Never tried fooling with it.

Maciej> I can't seem to find similar functionality in gtk

I guess you can make an "underlined label" widget and then just use it
instead of a label.

Note that if you're doing this, it would be nice if you could specify
the underline as part of the label string.  That way it is easier to
internationalize: (eg) you can just pass in the text "_Open" and not
have to run "_Open" through gettext and extract the underline position
by hand (or worse, find some nasty way to put the underline position
into the gettext database).

This has been an ongoing hassle when trying to internationalize
Tk-based applications; it would be cool if GTk made it easy.

Tom



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]