Tkinter :: Variable :: Class Variable
[hide private]
[frames] | no frames]

Class Variable

source code

Known Subclasses:
BooleanVar, DoubleVar, IntVar, StringVar

Class to define value holders for e.g. buttons.

Subclasses StringVar, IntVar, DoubleVar, BooleanVar are specializations that constrain the type of the value returned from get().

Instance Methods [hide private]
  __del__(self)
Unset the variable in Tcl.
  __init__(self, master=None)
Construct a variable with an optional MASTER as master widget.
  __str__(self)
Return the name of the variable in Tcl.
  get(self)
Return value of variable.
  set(self, value)
Set the variable to VALUE.
  trace(self, mode, callback)
Define a trace callback for the variable.
  trace_variable(self, mode, callback)
Define a trace callback for the variable.
  trace_vdelete(self, mode, cbname)
Delete the trace callback for a variable.
  trace_vinfo(self)
Return all trace callback information.

Class Variables [hide private]
  _default = ''

Method Details [hide private]

__del__(self)
(Destructor)

source code 
Unset the variable in Tcl.

__init__(self, master=None)
(Constructor)

source code 
Construct a variable with an optional MASTER as master widget. The variable is named PY_VAR_number in Tcl.

__str__(self)
(Informal representation operator)

source code 
Return the name of the variable in Tcl.

get(self)

source code 
Return value of variable.

set(self, value)

source code 
Set the variable to VALUE.

trace(self, mode, callback)

source code 

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.

trace_variable(self, mode, callback)

source code 

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.

trace_vdelete(self, mode, cbname)

source code 

Delete the trace callback for a variable.

MODE is one of "r", "w", "u" for read, write, undefine. CBNAME is the name of the callback returned from trace_variable or trace.

trace_vinfo(self)

source code 
Return all trace callback information.

Class Variable Details [hide private]

_default

None
Value:
''