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

Method _bind

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

Internal function.

(self, what, sequence, func, add, needcleanup=1)

Source from the content-addressed store, hash-verified

1391 self.tk.call('bindtags', self._w, tagList)
1392
1393 def _bind(self, what, sequence, func, add, needcleanup=1):
1394 """Internal function."""
1395 if isinstance(func, str):
1396 self.tk.call(what + (sequence, func))
1397 elif func:
1398 funcid = self._register(func, self._substitute,
1399 needcleanup)
1400 cmd = ('%sif {"[%s %s]" == "break"} break\n'
1401 %
1402 (add and '+' or '',
1403 funcid, self._subst_format_str))
1404 self.tk.call(what + (sequence, cmd))
1405 return funcid
1406 elif sequence:
1407 return self.tk.call(what + (sequence,))
1408 else:
1409 return self.tk.splitlist(self.tk.call(what))
1410
1411 def bind(self, sequence=None, func=None, add=None):
1412 """Bind to this widget at event SEQUENCE a call to function FUNC.

Callers 7

bindMethod · 0.95
bind_allMethod · 0.45
bind_classMethod · 0.45
tag_bindMethod · 0.45
tag_bindMethod · 0.45
_tag_bindMethod · 0.45
tag_bindMethod · 0.45

Calls 2

_registerMethod · 0.95
callMethod · 0.80

Tested by

no test coverage detected