Used to add tkinter events to a Window. The tkinter specific data is in the Window's member variable user_bind_event :param bind_string: The string tkinter expected in its bind function :type bind_string: (str) :param key: The event that will be gene
(self, bind_string, key, propagate=True)
| 12024 | return 'break' if propagate is not True else None |
| 12025 | |
| 12026 | def bind(self, bind_string, key, propagate=True): |
| 12027 | """ |
| 12028 | Used to add tkinter events to a Window. |
| 12029 | The tkinter specific data is in the Window's member variable user_bind_event |
| 12030 | :param bind_string: The string tkinter expected in its bind function |
| 12031 | :type bind_string: (str) |
| 12032 | :param key: The event that will be generated when the tkinter event occurs |
| 12033 | :type key: str | int | tuple | object |
| 12034 | :param propagate: If True then tkinter will be told to propagate the event |
| 12035 | :type propagate: (bool) |
| 12036 | """ |
| 12037 | if not self._is_window_created('tried Window.bind'): |
| 12038 | return |
| 12039 | try: |
| 12040 | self.TKroot.bind(bind_string, lambda evt: self._user_bind_callback(bind_string, evt, propagate)) |
| 12041 | except Exception as e: |
| 12042 | self.TKroot.unbind_all(bind_string) |
| 12043 | return |
| 12044 | # _error_popup_with_traceback('Window.bind error', e) |
| 12045 | self.user_bind_dict[bind_string] = key |
| 12046 | |
| 12047 | def unbind(self, bind_string): |
| 12048 | """ |
no test coverage detected