On Sun, 26 Mar 2006 22:01:17 +0200 geon <[EMAIL PROTECTED]> wrote: > Hi, > > On a canvas I would like to bind my "player" with arrows keys, but must > be there something wrong, cause it is not able to bind it. This is my code: > > from Tkinter import * > > def move(what): > print what.keycode > > > master=Tk() > myCanvas=Canvas(master, bg="white") > pos=(20,20,30,30) > player=myCanvas.create_oval(pos, fill="blue") > > myCanvas.focus(player) > myCanvas.tag_bind(player, "<Up>", move) > myCanvas.pack() > > mainloop() >
Hi Geon, I don't think you can pass keyboard focus to canvas items this way, you will have to bind to the Canvas widget itself. Michael _______________________________________________ Tkinter-discuss mailing list [email protected] http://mail.python.org/mailman/listinfo/tkinter-discuss
