PyDocs

Nav

Graphical user interfaces with Tk

Variable

tkinter

class
  • Variable(master=None, value=None, name=None)
The base class for the Tk variable wrappers. A Tk variable is a value stored in the Tcl interpreter that can be linked to widgets through their variable or textvariable options (see Coupling widget variables), so that changes propagate both ways: updating the variable updates every widget bound to it, and a user editing such a widget updates the variable.
Changed in 3.10
  • 3.10: Two variables now compare equal (==) only when they have the same name, are of the same class, and belong to the same Tcl interpreter.
Members of Variable

g

get
Return the current value of the variable.

i

initialize
Set the variable to value.

s

set
Set the variable to value.

t

trace
Register callback to be called when the variable is accessed according to mode.
trace_add
Register callback to be called when the variable is accessed according to mode.
trace_info
Return a list of (modes, cbname) pairs describing all traces currently set on the variable, where modes is a tuple of mode strings and cbname is the internal callback name.
trace_remove
Remove a trace callback from the variable.
trace_variable
Register callback to be called when the variable is accessed according to mode.
trace_vdelete
Remove the trace callback named cbname registered for mode with trace_variable().
trace_vinfo
Return a list of (mode, cbname) pairs for all traces set on the variable with trace_variable().
0 Examples
No examples for tkinter/Variable.
See Also
No see-alsos for tkinter/Variable
0 Notes
No notes for Variable