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

Class StringVar

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

Value holder for strings variables.

Source from the content-addressed store, hash-verified

546
547
548class StringVar(Variable):
549 """Value holder for strings variables."""
550 _default = ""
551
552 def __init__(self, master=None, value=None, name=None):
553 """Construct a string variable.
554
555 MASTER can be given as master widget.
556 VALUE is an optional value (defaults to "")
557 NAME is an optional Tcl name (defaults to PY_VARnum).
558
559 If NAME matches an existing variable and VALUE is omitted
560 then the existing value is retained.
561 """
562 Variable.__init__(self, master, value, name)
563
564 def get(self):
565 """Return value of variable as string."""
566 value = self._tk.globalgetvar(self._name)
567 if isinstance(value, str):
568 return value
569 return str(value)
570
571
572class 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