Value holder for float variables.
| 616 | |
| 617 | |
| 618 | class DoubleVar(Variable): |
| 619 | """Value holder for float variables.""" |
| 620 | _default = 0.0 |
| 621 | |
| 622 | def __init__(self, master=None, value=None, name=None): |
| 623 | """Construct a float variable. |
| 624 | |
| 625 | MASTER can be given as master widget. |
| 626 | VALUE is an optional value (defaults to 0.0) |
| 627 | NAME is an optional Tcl name (defaults to PY_VARnum). |
| 628 | |
| 629 | If NAME matches an existing variable and VALUE is omitted |
| 630 | then the existing value is retained. |
| 631 | """ |
| 632 | Variable.__init__(self, master, value, name) |
| 633 | |
| 634 | def get(self): |
| 635 | """Return the value of the variable as a float.""" |
| 636 | return self._tk.getdouble(self._tk.globalgetvar(self._name)) |
| 637 | |
| 638 | |
| 639 | class BooleanVar(Variable): |
no outgoing calls
searching dependent graphs…