MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / IntVar

Class IntVar

tools/python-3.11.9-amd64/Lib/tkinter/__init__.py:572–594  ·  view source on GitHub ↗

Value holder for integer variables.

Source from the content-addressed store, hash-verified

570
571
572class IntVar(Variable):
573 """Value holder for integer variables."""
574 _default = 0
575
576 def __init__(self, master=None, value=None, name=None):
577 """Construct an integer variable.
578
579 MASTER can be given as master widget.
580 VALUE is an optional value (defaults to 0)
581 NAME is an optional Tcl name (defaults to PY_VARnum).
582
583 If NAME matches an existing variable and VALUE is omitted
584 then the existing value is retained.
585 """
586 Variable.__init__(self, master, value, name)
587
588 def get(self):
589 """Return the value of the variable as an integer."""
590 value = self._tk.globalgetvar(self._name)
591 try:
592 return self._tk.getint(value)
593 except (TypeError, TclError):
594 return int(self._tk.getdouble(value))
595
596
597class DoubleVar(Variable):

Callers 7

test_defaultMethod · 0.90
test_getMethod · 0.90
test_invalid_valueMethod · 0.90
create_page_windowsMethod · 0.90
create_page_shedMethod · 0.90
setUpClassMethod · 0.90
addoptionsMethod · 0.50

Calls

no outgoing calls

Tested by 4

test_defaultMethod · 0.72
test_getMethod · 0.72
test_invalid_valueMethod · 0.72
setUpClassMethod · 0.72