Back to index

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

List of all members.

Public Member Functions

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

Static Public Attributes

 trace = trace_variable

Static Private Attributes

float _default = 0.0

Detailed Description

Value holder for float variables.

Definition at line 277 of file __init__.py.


Constructor & Destructor Documentation

def tkinter.DoubleVar.__init__ (   self,
  master = None,
  value = None,
  name = None 
)
Construct a float variable.

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

00280 
00281     def __init__(self, master=None, value=None, name=None):
00282         """Construct a float variable.
00283 
00284         MASTER can be given as master widget.
00285         VALUE is an optional value (defaults to 0.0)
00286         NAME is an optional Tcl name (defaults to PY_VARnum).
00287 
00288         If NAME matches an existing variable and VALUE is omitted
00289         then the existing value is retained.
00290         """
00291         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.DoubleVar.get (   self)
Return the value of the variable as a float.

Reimplemented from tkinter.Variable.

Definition at line 292 of file __init__.py.

00292 
00293     def get(self):
00294         """Return the value of the variable as a float."""
00295         return getdouble(self._tk.globalgetvar(self._name))

Here is the caller graph for this function:

def tkinter.Variable.set (   self,
  value 
) [inherited]
Set the variable to VALUE.

Reimplemented in tkinter.IntVar.

Definition at line 190 of file __init__.py.

00190 
00191     def set(self, value):
00192         """Set the variable to VALUE."""
        return self._tk.globalsetvar(self._name, 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

float tkinter.DoubleVar._default = 0.0 [static, private]

Reimplemented from tkinter.Variable.

Definition at line 279 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: