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

Derk Gwen derkgwen at HotPOP.com
Mon Jan 13 20:07:38 EST 2003


morden <morden at shadows.net> wrote:
# Derk Gwen wrote:
# 
# > # 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. 
# 
# Is there a platform independent way of doing this or I should
# use X11 specific commands for this?

In Tcl/Tk, you use the bind and bindtags commands.
	http://www.tcl.tk/man/tcl8.4/TkCmd/bind.htm
	http://www.tcl.tk/man/tcl8.4/TkCmd/bindtags.htm
I don't know about python.

--
Derk Gwen http://derkgwen.250free.com/html/index.html
I'm not even supposed to be here today.




More information about the Python-list mailing list