Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes | Static Private Attributes
tkinter.IntVar Class Reference
Inheritance diagram for tkinter.IntVar:
Inheritance graph
[legend]
Collaboration diagram for tkinter.IntVar:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def set
def get
def __str__
def trace_variable
def trace_vdelete
def trace_vinfo
def __eq__

Static Public Attributes

 trace = trace_variable

Static Private Attributes

int _default = 0

Detailed Description

Value holder for integer variables.

Definition at line 252 of file __init__.py.


Constructor & Destructor Documentation

def tkinter.IntVar.__init__ (   self,
  master = None,
  value = None,
  name = None 
)
Construct an integer variable.

MASTER can be given as master widget.
VALUE is an optional value (defaults to 0)
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.

Reimplemented from tkinter.Variable.

Definition at line 255 of file __init__.py.

00255 
00256     def __init__(self, master=None, value=None, name=None):
00257         """Construct an integer variable.
00258 
00259         MASTER can be given as master widget.
00260         VALUE is an optional value (defaults to 0)
00261         NAME is an optional Tcl name (defaults to PY_VARnum).
00262 
00263         If NAME matches an existing variable and VALUE is omitted
00264         then the existing value is retained.
00265         """
00266         Variable.__init__(self, master, value, name)

Here is the caller graph for this function:


Member Function Documentation

def tkinter.Variable.__eq__ (   self,
  other 
) [inherited]
Comparison for equality (==).

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

Definition at line 221 of file __init__.py.

00221 
00222     def __eq__(self, other):
00223         """Comparison for equality (==).
00224 
00225         Note: if the Variable's master matters to behavior
00226         also compare self._master == other._master
00227         """
00228         return self.__class__.__name__ == other.__class__.__name__ \
00229             and self._name == other._name

def tkinter.Variable.__str__ (   self) [inherited]
Return the name of the variable in Tcl.

Definition at line 187 of file __init__.py.

00187 
00188     def __str__(self):
00189         """Return the name of the variable in Tcl."""
        return self._name
def tkinter.IntVar.get (   self)
Return the value of the variable as an integer.

Reimplemented from tkinter.Variable.

Definition at line 273 of file __init__.py.

00273 
00274     def get(self):
00275         """Return the value of the variable as an integer."""
00276         return getint(self._tk.globalgetvar(self._name))

Here is the caller graph for this function:

def tkinter.IntVar.set (   self,
  value 
)
Set the variable to value, converting booleans to integers.

Reimplemented from tkinter.Variable.

Definition at line 267 of file __init__.py.

00267 
00268     def set(self, value):
00269         """Set the variable to value, converting booleans to integers."""
00270         if isinstance(value, bool):
00271             value = int(value)
00272         return Variable.set(self, value)

Here is the caller graph for this function:

def tkinter.Variable.trace_variable (   self,
  mode,
  callback 
) [inherited]
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.

Definition at line 196 of file __init__.py.

00196 
00197     def trace_variable(self, mode, callback):
00198         """Define a trace callback for the variable.
00199 
00200         MODE is one of "r", "w", "u" for read, write, undefine.
00201         CALLBACK must be a function which is called when
00202         the variable is read, written or undefined.
00203 
00204         Return the name of the callback.
00205         """
00206         cbname = self._master._register(callback)
00207         self._tk.call("trace", "variable", self._name, mode, cbname)
        return cbname
def tkinter.Variable.trace_vdelete (   self,
  mode,
  cbname 
) [inherited]
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.

Definition at line 209 of file __init__.py.

00209 
00210     def trace_vdelete(self, mode, cbname):
00211         """Delete the trace callback for a variable.
00212 
00213         MODE is one of "r", "w", "u" for read, write, undefine.
00214         CBNAME is the name of the callback returned from trace_variable or trace.
00215         """
00216         self._tk.call("trace", "vdelete", self._name, mode, cbname)
        self._master.deletecommand(cbname)
def tkinter.Variable.trace_vinfo (   self) [inherited]
Return all trace callback information.

Definition at line 217 of file __init__.py.

00217 
00218     def trace_vinfo(self):
00219         """Return all trace callback information."""
00220         return [self._tk.split(x) for x in self._tk.splitlist(
            self._tk.call("trace", "vinfo", self._name))]

Member Data Documentation

int tkinter.IntVar._default = 0 [static, private]

Reimplemented from tkinter.Variable.

Definition at line 254 of file __init__.py.

tkinter.Variable.trace = trace_variable [static, inherited]

Definition at line 208 of file __init__.py.


The documentation for this class was generated from the following file: