New submission from Juliette Monsel:
I am using python 3.6.2 with tk 8.6.7 in Linux and when I call
widget.unbind(<Sequence>, funcid), it unbinds all bindings for <Sequence>,
while I would expect it to unbind only funcid. Here is an example reproducing
the problem:
import tkinter as tk
root = tk.Tk()
def cmd1(event):
print('1')
def cmd2(event):
print('2')
def unbind1():
l.unbind('<Motion>', b1)
def unbind2():
l.unbind('<Motion>', b2)
l = tk.Label(root, text='Hover')
b1 = l.bind('<Motion>', cmd1)
b2 = l.bind('<Motion>', cmd2, True)
l.pack()
tk.Button(root, text='Unbind 1', command=unbind1).pack()
tk.Button(root, text='Unbind 2', command=unbind2).pack()
root.mainloop()
In this example, clicking on one of the buttons unbinds both bindings instead
of only one.
----------
components: Tkinter
messages: 302256
nosy: j-4321-i
priority: normal
severity: normal
status: open
title: Tkinter widget.unbind(sequence, funcid) unbind all bindings
type: behavior
versions: Python 3.6
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31485>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com