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

Method _bind

Lib/tkinter/__init__.py:1488–1504  ·  view source on GitHub ↗

Internal function.

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

Source from the content-addressed store, hash-verified

1486 self.tk.call('bindtags', self._w, tagList)
1487
1488 def _bind(self, what, sequence, func, add, needcleanup=1):
1489 """Internal function."""
1490 if isinstance(func, str):
1491 self.tk.call(what + (sequence, func))
1492 elif func:
1493 funcid = self._register(func, self._substitute,
1494 needcleanup)
1495 cmd = ('%sif {"[%s %s]" == "break"} break\n'
1496 %
1497 (add and '+' or '',
1498 funcid, self._subst_format_str))
1499 self.tk.call(what + (sequence, cmd))
1500 return funcid
1501 elif sequence:
1502 return self.tk.call(what + (sequence,))
1503 else:
1504 return self.tk.splitlist(self.tk.call(what))
1505
1506 def bind(self, sequence=None, func=None, add=None):
1507 """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 3

_registerMethod · 0.95
isinstanceFunction · 0.85
callMethod · 0.45

Tested by

no test coverage detected