MCPcopy Index your code
hub / github.com/python/cpython / trace_remove

Method trace_remove

Lib/tkinter/__init__.py:473–490  ·  view source on GitHub ↗

Delete the trace callback for a variable. Mode is one of "read", "write", "unset" or a list or tuple of such strings. Must be same as were specified in trace_add(). cbname is the name of the callback returned from trace_add().

(self, mode, cbname)

Source from the content-addressed store, hash-verified

471 return cbname
472
473 def trace_remove(self, mode, cbname):
474 """Delete the trace callback for a variable.
475
476 Mode is one of "read", "write", "unset" or a list or tuple of
477 such strings. Must be same as were specified in trace_add().
478 cbname is the name of the callback returned from trace_add().
479 """
480 self._tk.call('trace', 'remove', 'variable',
481 self._name, mode, cbname)
482 for m, ca in self.trace_info():
483 if self._tk.splitlist(ca)[0] == cbname:
484 break
485 else:
486 self._tk.deletecommand(cbname)
487 try:
488 self._tclCommands.remove(cbname)
489 except ValueError:
490 pass
491
492 def trace_info(self):
493 """Return all trace callback information."""

Callers 4

test_traceMethod · 0.95
destroyMethod · 0.80
test_trace_variableMethod · 0.80
detachMethod · 0.80

Calls 5

trace_infoMethod · 0.95
splitlistMethod · 0.80
deletecommandMethod · 0.80
callMethod · 0.45
removeMethod · 0.45

Tested by 2

test_traceMethod · 0.76
test_trace_variableMethod · 0.64