Internal function.
(self, what, sequence, func, add, needcleanup=1)
| 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. |