MCPcopy Index your code
hub / github.com/RustPython/RustPython / trace_add

Method trace_add

Lib/tkinter/__init__.py:452–465  ·  view source on GitHub ↗

Define a trace callback for the variable. Mode is one of "read", "write", "unset", or a list or tuple of such strings. Callback must be a function which is called when the variable is read, written or unset. Return the name of the callback.

(self, mode, callback)

Source from the content-addressed store, hash-verified

450 return cbname
451
452 def trace_add(self, mode, callback):
453 """Define a trace callback for the variable.
454
455 Mode is one of "read", "write", "unset", or a list or tuple of
456 such strings.
457 Callback must be a function which is called when the variable is
458 read, written or unset.
459
460 Return the name of the callback.
461 """
462 cbname = self._register(callback)
463 self._tk.call('trace', 'add', 'variable',
464 self._name, mode, (cbname,))
465 return cbname
466
467 def trace_remove(self, mode, cbname):
468 """Delete the trace callback for a variable.

Callers 1

__init__Method · 0.80

Calls 2

_registerMethod · 0.95
callMethod · 0.45

Tested by

no test coverage detected