Hi.
I wonder how I can run the code button when you press alt-h.
Use underline, but I can not connect.
code:
import Tkinter
class App:
def __init__(self, master):
self.root = master
b = Tkinter.Button(self.root, text='Hello', underline=0)
b.pack()
Cristian,
You have to bind your Alt key presses separately. The underline= only
underlines the letter - it does not bind to an event handler.
Here's a snippet that may give you some ideas. Disclaimer: I'm not sure
if its best practice or not.
Malcolm
Treat Alt+I as a shortcut keystroke for
- Mensaje reenviado
De: pyt...@bdurham.com
Para: craf p...@vtr.net, Python Tkinter Ingles
tkinter-discuss@python.org
Asunto: Re: [Tkinter-discuss] Use underline
Fecha: Wed, 29 Dec 2010 13:52:08 -0500
Cristian,
You have to bind your Alt key presses separately. The