Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TkInter: understanding unbind function

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 Answers

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.

like image 142
Bryan Oakley Avatar answered Jul 29 '26 19:07

Bryan Oakley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!