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

Class StringVar

Lib/tkinter/__init__.py:569–590  ·  view source on GitHub ↗

Value holder for strings variables.

Source from the content-addressed store, hash-verified

567
568
569class StringVar(Variable):
570 """Value holder for strings variables."""
571 _default = ""
572
573 def __init__(self, master=None, value=None, name=None):
574 """Construct a string variable.
575
576 MASTER can be given as master widget.
577 VALUE is an optional value (defaults to "")
578 NAME is an optional Tcl name (defaults to PY_VARnum).
579
580 If NAME matches an existing variable and VALUE is omitted
581 then the existing value is retained.
582 """
583 Variable.__init__(self, master, value, name)
584
585 def get(self):
586 """Return value of variable as string."""
587 value = self._tk.globalgetvar(self._name)
588 if isinstance(value, str):
589 return value
590 return str(value)
591
592
593class IntVar(Variable):

Callers 15

test_equalityMethod · 0.90
test_defaultMethod · 0.90
test_getMethod · 0.90
test_get_nullMethod · 0.90
_dyn_option_menuFunction · 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
load_extensionsMethod · 0.90

Calls

no outgoing calls

Tested by 5

test_equalityMethod · 0.72
test_defaultMethod · 0.72
test_getMethod · 0.72
test_get_nullMethod · 0.72
test_addMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…