0

I'm making a little game and I can't get button bindings to work. Here is what I have so far

def forward(event):
    print "up"

frame.bind("<Up>",forward)

but pressing the up arrow does nothing...is there something I missed?

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by pyTony
0

Maybe you are defining function in class and forgot to include self parameter, works, when I added it in init of my tkinter program

main.bind("<Up>", self.forward)

and the def into the class.

Also to my Photoimage post it worked, but must bind to master, not frame

Edited by pyTony: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.