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

_ClassType Variable

Known Subclasses:

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]
 
__init__(self, master=None, value=None, name=None)
Construct a variable
 
__del__(self)
Unset the variable in Tcl.
 
__str__(self)
Return the name of the variable in Tcl.
 
set(self, value)
Set the variable to VALUE.
 
get(self)
Return value of variable.
 
trace_variable(self, mode, callback)
Define a trace callback for the variable.
 
trace(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.
 
__eq__(self, other)
Comparison for equality (==).
Class Variables [hide private]
  _default = ''
Method Details [hide private]

__init__(self, master=None, value=None, name=None)
(Constructor)

 

Construct a variable

MASTER can be given as master widget. VALUE is an optional value (defaults to "") NAME is an optional Tcl name (defaults to PY_VARnum).

If NAME matches an existing variable and VALUE is omitted then the existing value is retained.

trace_variable(self, mode, callback)

 

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(self, mode, callback)

 

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)

 

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.

__eq__(self, other)
(Equality operator)

 

Comparison for equality (==).

Note: if the Variable's master matters to behavior also compare self._master == other._master