Ich hab ein Problem mit den Events bei Tastendruck und ich weiss nicht woran das liegt.
Code: Alles auswählen
winObj.vidoeList.bind('<ButtonRelease-2>',winObj.insertModus)
winObj.vidoeList.bind('<KeyRelease-Return>',winObj.insertModus)
Gruss.
Code: Alles auswählen
winObj.vidoeList.bind('<ButtonRelease-2>',winObj.insertModus)
winObj.vidoeList.bind('<KeyRelease-Return>',winObj.insertModus)
Code: Alles auswählen
def myfunc(event):
print 'Hello!'
button = Button(root, text = 'Ok')
button.bind('<Button-1>', myfunc) #linke Maustaste
button.bind('<Return>', myfunc) # Return Taste
Code: Alles auswählen
winObj.vidoeList.bind('<ButtonRelease-2>',winObj.insertModus)
winObj.vidoeList.bind('<Return>',winObj.insertModus)
...
def insertModus(winObj,event):
winObj.insertView=Tk()
...
Code: Alles auswählen
import Tkinter as tk
def myfunc(event):
print 'Hallo turner'
root = tk.Tk()
button = tk.Button(root,text='Hallo turner')
button.pack()
button.bind('<Return>', myfunc) # Return Taste
button.focus_set()
root.mainloop()