MCPcopy Index your code
hub / github.com/python/cpython / IntVar

Class IntVar

Lib/tkinter/__init__.py:593–615  ·  view source on GitHub ↗

Value holder for integer variables.

Source from the content-addressed store, hash-verified

591
592
593class IntVar(Variable):
594 """Value holder for integer variables."""
595 _default = 0
596
597 def __init__(self, master=None, value=None, name=None):
598 """Construct an integer variable.
599
600 MASTER can be given as master widget.
601 VALUE is an optional value (defaults to 0)
602 NAME is an optional Tcl name (defaults to PY_VARnum).
603
604 If NAME matches an existing variable and VALUE is omitted
605 then the existing value is retained.
606 """
607 Variable.__init__(self, master, value, name)
608
609 def get(self):
610 """Return the value of the variable as an integer."""
611 value = self._tk.globalgetvar(self._name)
612 try:
613 return self._tk.getint(value)
614 except (TypeError, TclError):
615 return int(self._tk.getdouble(value))
616
617
618class DoubleVar(Variable):

Callers 6

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

Calls

no outgoing calls

Tested by 4

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…