Tkinter question: how to make hotkeys work

Eric Brunel eric.brunel at pragmadev.com
Tue Jul 23 04:41:01 EDT 2002


Gabe Newcomb wrote:

> (I'm working in Win2k)
> 
> I've found how to underline a letter on a Button widget, but I can't
> seem to use the hotkey to trigger it (Alt + underlined key). What am I
> missing?

To quote Tk's documentation for the -underline option of the button command 
(the stars are mine):
"Specifies the integer index of a character to underline in the widget. 
This option is used by the default bindings to implement keyboard traversal 
for **menu** buttons and **menu** entries. 0 corresponds to the first 
character of the text displayed in the widget, 1 to the next character, and 
so on."

So apparently, for regular buttons, this option does just what it says: 
underline a character. You'll have to do explicitly the binding with bind 
to make it work...

> Additionally, if there is a Tkinter mailing group, please let me know.

Apart from this one and comp.lang.tcl for tk questions/issues, I 
don't know of any.

HTH
-- 
- Eric Brunel <eric.brunel at pragmadev.com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com



More information about the Python-list mailing list