MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / trace_add

Method trace_add

tools/python-3.11.9-amd64/Lib/tkinter/__init__.py:449–462  ·  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

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

Callers 3

test_traceMethod · 0.95
test_trace_variableMethod · 0.80
attachMethod · 0.80

Calls 2

_registerMethod · 0.95
callMethod · 0.80

Tested by 2

test_traceMethod · 0.76
test_trace_variableMethod · 0.64