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)
| 2262 | positionfrom = wm_positionfrom |
| 2263 | |
| 2264 | def wm_protocol(self, name=None, func=None): |
| 2265 | """Bind function FUNC to command NAME for this widget. |
| 2266 | Return the function bound to NAME if None is given. NAME could be |
| 2267 | e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW".""" |
| 2268 | if callable(func): |
| 2269 | command = self._register(func) |
| 2270 | else: |
| 2271 | command = func |
| 2272 | return self.tk.call( |
| 2273 | 'wm', 'protocol', self._w, name, command) |
| 2274 | |
| 2275 | protocol = wm_protocol |
| 2276 |