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

Class BooleanVar

Lib/tkinter/__init__.py:639–666  ·  view source on GitHub ↗

Value holder for boolean variables.

Source from the content-addressed store, hash-verified

637
638
639class BooleanVar(Variable):
640 """Value holder for boolean variables."""
641 _default = False
642
643 def __init__(self, master=None, value=None, name=None):
644 """Construct a boolean variable.
645
646 MASTER can be given as master widget.
647 VALUE is an optional value (defaults to False)
648 NAME is an optional Tcl name (defaults to PY_VARnum).
649
650 If NAME matches an existing variable and VALUE is omitted
651 then the existing value is retained.
652 """
653 Variable.__init__(self, master, value, name)
654
655 def set(self, value):
656 """Set the variable to VALUE."""
657 return self._tk.globalsetvar(self._name, self._tk.getboolean(value))
658
659 initialize = set
660
661 def get(self):
662 """Return the value of the variable as a bool."""
663 try:
664 return self._tk.getboolean(self._tk.globalgetvar(self._name))
665 except TclError:
666 raise ValueError("invalid literal for getboolean()")
667
668
669def mainloop(n=0):

Callers 15

test_defaultMethod · 0.90
test_getMethod · 0.90
test_setMethod · 0.90
create_page_fontMethod · 0.90
create_page_highlightMethod · 0.90
create_page_keysMethod · 0.90
create_page_windowsMethod · 0.90
create_page_shedMethod · 0.90
__init__Method · 0.90
__init__Method · 0.90
create_extraMethod · 0.90

Calls

no outgoing calls

Tested by 6

test_defaultMethod · 0.72
test_getMethod · 0.72
test_setMethod · 0.72
setUpClassMethod · 0.72
test_find_againMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…