Tk: How would I add an accelerator on a button/label in tkinter

Derk Gwen derkgwen at HotPOP.com
Mon Jan 13 18:50:40 EST 2003


# How could I make the button pressed when user presses Alt-P
# on the keyboard? I saw accelerators on menus in Tk screenshots
# found on the web but I haven't seen any on standalone buttons.
# Is there any way to get those?

All a menu accelerator is is a comment on the displayed menu. To actually
implement the accelerator, you bind the key sequence to a command. This
binding is independent of whether there is button or menu that does the
same thing.

--
Derk Gwen http://derkgwen.250free.com/html/index.html
There are subtler ways of badgering a witness.




More information about the Python-list mailing list