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

Method _register

Lib/tkinter/__init__.py:1701–1721  ·  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

1699 _nametowidget = nametowidget
1700
1701 def _register(self, func, subst=None, needcleanup=1):
1702 """Return a newly created Tcl function. If this
1703 function is called, the Python function FUNC will
1704 be executed. An optional function SUBST can
1705 be given which will be executed before FUNC."""
1706 f = CallWrapper(func, subst, self).__call__
1707 name = repr(id(f))
1708 try:
1709 func = func.__func__
1710 except AttributeError:
1711 pass
1712 try:
1713 name = name + func.__name__
1714 except AttributeError:
1715 pass
1716 self.tk.createcommand(name, f)
1717 if needcleanup:
1718 if self._tclCommands is None:
1719 self._tclCommands = []
1720 self._tclCommands.append(name)
1721 return name
1722
1723 register = _register
1724

Callers 6

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

Calls 3

CallWrapperClass · 0.85
idFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected