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

Method _register

Lib/tkinter/__init__.py:1683–1703  ·  view source on GitHub ↗

Return a newly created Tcl function. If this function is called, the Python function FUNC will be executed. An optional function SUBST can be given which will be executed before FUNC.

(self, func, subst=None, needcleanup=1)

Source from the content-addressed store, hash-verified

1681 _nametowidget = nametowidget
1682
1683 def _register(self, func, subst=None, needcleanup=1):
1684 """Return a newly created Tcl function. If this
1685 function is called, the Python function FUNC will
1686 be executed. An optional function SUBST can
1687 be given which will be executed before FUNC."""
1688 f = CallWrapper(func, subst, self).__call__
1689 name = repr(id(f))
1690 try:
1691 func = func.__func__
1692 except AttributeError:
1693 pass
1694 try:
1695 name = name + func.__name__
1696 except AttributeError:
1697 pass
1698 self.tk.createcommand(name, f)
1699 if needcleanup:
1700 if self._tclCommands is None:
1701 self._tclCommands = []
1702 self._tclCommands.append(name)
1703 return name
1704
1705 register = _register
1706

Callers 6

afterMethod · 0.95
selection_handleMethod · 0.95
_bindMethod · 0.95
_optionsMethod · 0.95
wm_protocolMethod · 0.45
dumpMethod · 0.45

Calls 4

CallWrapperClass · 0.85
reprFunction · 0.85
idFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected