How to bind spacebar key to a certain method in tkinter (python)

前端 未结 3 1429
萌比男神i
萌比男神i 2020-12-19 01:44

I am working on a project in python, and I made a method to draw a specific thing in tkinter. I want it so that whenever I press the spacebar, the image will redraw itself (

3条回答
  •  甜味超标
    2020-12-19 02:36

    You can aslo use canvas.bind_all("", yourFunction) That will listen for events in the whole application and not only on widget.

提交回复
热议问题