diff options
| author | Larry Hastings <larry@hastings.org> | 2016-06-27 02:53:18 (GMT) |
|---|---|---|
| committer | Larry Hastings <larry@hastings.org> | 2016-06-27 02:53:18 (GMT) |
| commit | 1b329e791ae3a3a2989f05e8c2019b67b4e1a7df (patch) | |
| tree | 91e137c00f35f21a2c17b385f9746492b8347558 /Lib/tkinter/__init__.py | |
| parent | 9bb200545970bb920c83124658cb89c7d295166d (diff) | |
| parent | 1e957d145fa1fc05ca1fbb9f135ab162c939ae14 (diff) | |
| download | cpython-1b329e791ae3a3a2989f05e8c2019b67b4e1a7df.zip cpython-1b329e791ae3a3a2989f05e8c2019b67b4e1a7df.tar.gz cpython-1b329e791ae3a3a2989f05e8c2019b67b4e1a7df.tar.bz2 | |
Merge.
Diffstat (limited to 'Lib/tkinter/__init__.py')
| -rw-r--r-- | Lib/tkinter/__init__.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index aa646dc..55bfb7f 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -271,7 +271,7 @@ class Variable: Return the name of the callback. """ - f = CallWrapper(callback, None, self).__call__ + f = CallWrapper(callback, None, self._root).__call__ cbname = repr(id(f)) try: callback = callback.__func__ @@ -295,14 +295,19 @@ class Variable: CBNAME is the name of the callback returned from trace_variable or trace. """ self._tk.call("trace", "vdelete", self._name, mode, cbname) - self._tk.deletecommand(cbname) - try: - self._tclCommands.remove(cbname) - except ValueError: - pass + cbname = self._tk.splitlist(cbname)[0] + for m, ca in self.trace_vinfo(): + if self._tk.splitlist(ca)[0] == cbname: + break + else: + self._tk.deletecommand(cbname) + try: + self._tclCommands.remove(cbname) + except ValueError: + pass def trace_vinfo(self): """Return all trace callback information.""" - return [self._tk.split(x) for x in self._tk.splitlist( + return [self._tk.splitlist(x) for x in self._tk.splitlist( self._tk.call("trace", "vinfo", self._name))] def __eq__(self, other): """Comparison for equality (==). |
