问题
Does TkInter unbind function prevents the widget on which it is applied from binding further events to the widget ?
Clarification:
Let's say I bound events to a canvas earlier in a prgram:
canvas.bind("<Button-1>",some_function)
Then at a certain point of the program, we no longer need those events:
canvas.unbind("<Button-1>")
Can we later do something like this:
canvas.bind("<Button-1>",OTHER_function)
回答1:
No, unbinding an event doesn't prevent further bindings on the widget. You can bind an event, unbind it, and then bind it again at a later date as often as you want.
来源:https://stackoverflow.com/questions/30195729/tkinter-understanding-unbind-function