Bind function FUNC to command NAME for this widget. Return the function bound to NAME if None is given. NAME could be e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW".
(self, name=None, func=None)
| 2452 | positionfrom = wm_positionfrom |
| 2453 | |
| 2454 | def wm_protocol(self, name=None, func=None): |
| 2455 | """Bind function FUNC to command NAME for this widget. |
| 2456 | Return the function bound to NAME if None is given. NAME could be |
| 2457 | e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW".""" |
| 2458 | if callable(func): |
| 2459 | command = self._register(func) |
| 2460 | else: |
| 2461 | command = func |
| 2462 | return self.tk.call( |
| 2463 | 'wm', 'protocol', self._w, name, command) |
| 2464 | |
| 2465 | protocol = wm_protocol |
| 2466 |