Define a trace callback for the variable. MODE is one of "r", "w", "u" for read, write, undefine. CALLBACK must be a function which is called when the variable is read, written or undefined. Return the name of the callback. This deprecated method wraps a de
(self, mode, callback)
| 490 | splitlist(self._tk.call('trace', 'info', 'variable', self._name)))] |
| 491 | |
| 492 | def trace_variable(self, mode, callback): |
| 493 | """Define a trace callback for the variable. |
| 494 | |
| 495 | MODE is one of "r", "w", "u" for read, write, undefine. |
| 496 | CALLBACK must be a function which is called when |
| 497 | the variable is read, written or undefined. |
| 498 | |
| 499 | Return the name of the callback. |
| 500 | |
| 501 | This deprecated method wraps a deprecated Tcl method that will |
| 502 | likely be removed in the future. Use trace_add() instead. |
| 503 | """ |
| 504 | # TODO: Add deprecation warning |
| 505 | cbname = self._register(callback) |
| 506 | self._tk.call("trace", "variable", self._name, mode, cbname) |
| 507 | return cbname |
| 508 | |
| 509 | trace = trace_variable |
| 510 |