Unable to unbind a function using tkinter Unable to unbind a function using tkinter tkinter tkinter

Unable to unbind a function using tkinter


The second argument to unbind is a 'funcid', not a function. help(root.unbind) returns

unbind(sequence, funcid=None) method of tkinter.Tk instance. Unbind for this widget for event SEQUENCE the function identified with FUNCID.

Many tk functions return tk object ids that can be arguments for other funtions, and bind is one of them.

>>> i = root.bind('<Button-1>', int)>>> i'1733092354312int'>>> root.unbind('<Button-1>', i)  # Specific binding removed.

Buried in the output from help(root.bind) is this: "Bind will return an identifier to allow deletion of the bound function with unbind without memory leak."