MCPcopy Index your code
hub / github.com/RustPython/RustPython / _loadtk

Method _loadtk

Lib/tkinter/__init__.py:2475–2499  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2473 self._loadtk()
2474
2475 def _loadtk(self):
2476 self._tkloaded = True
2477 global _default_root
2478 # Version sanity checks
2479 tk_version = self.tk.getvar('tk_version')
2480 if tk_version != _tkinter.TK_VERSION:
2481 raise RuntimeError("tk.h version (%s) doesn't match libtk.a version (%s)"
2482 % (_tkinter.TK_VERSION, tk_version))
2483 # Under unknown circumstances, tcl_version gets coerced to float
2484 tcl_version = str(self.tk.getvar('tcl_version'))
2485 if tcl_version != _tkinter.TCL_VERSION:
2486 raise RuntimeError("tcl.h version (%s) doesn't match libtcl.a version (%s)" \
2487 % (_tkinter.TCL_VERSION, tcl_version))
2488 # Create and register the tkerror and exit commands
2489 # We need to inline parts of _register here, _ register
2490 # would register differently-named commands.
2491 if self._tclCommands is None:
2492 self._tclCommands = []
2493 self.tk.createcommand('tkerror', _tkerror)
2494 self.tk.createcommand('exit', _exit)
2495 self._tclCommands.append('tkerror')
2496 self._tclCommands.append('exit')
2497 if _support_default_root and _default_root is None:
2498 _default_root = self
2499 self.protocol("WM_DELETE_WINDOW", self.destroy)
2500
2501 def destroy(self):
2502 """Destroy this and all descendants widgets. This will

Callers 2

__init__Method · 0.95
loadtkMethod · 0.95

Calls 4

strFunction · 0.85
getvarMethod · 0.45
appendMethod · 0.45
protocolMethod · 0.45

Tested by

no test coverage detected