您只需
bind()使用事件的新功能再次调用即可。既然你没有利用第三个参数,
add在
bind()此只是简单地覆盖任何已经存在。默认情况下,此参数为,
''但它也接受
"+",它将在该事件已触发的回调中添加回调。
但是,如果您开始使用该可选参数,则需要使用该
unbind()函数删除单个回调。当你调用
bind()一个
funcid返回。您可以将此
funcid作为第二个参数传递给
unbind()。
例:
self.btn_funcid = self.DrawArea.bind("<Button 1>", self.my_button_callback, "+")# Then some time later, to remove just the 'my_button_callback':self.DrawArea.unbind("<Button 1>", self.btn_funcid)# But if you want to remove all of the callbacks for the event:self.DrawArea.unbind("<Button 1>")


