parent - parent of this dialog action - the name of the virtual event these keys will be mapped to current_key_sequences - a list of all key sequence lists currently mapped to virtual events, for overlap checking
(self, parent, action, current_key_sequences)
| 47 | keyerror_title = 'Key Sequence Error' |
| 48 | |
| 49 | def __init__(self, parent, action, current_key_sequences): |
| 50 | """ |
| 51 | parent - parent of this dialog |
| 52 | action - the name of the virtual event these keys will be |
| 53 | mapped to |
| 54 | current_key_sequences - a list of all key sequence lists |
| 55 | currently mapped to virtual events, for overlap checking |
| 56 | """ |
| 57 | super().__init__(parent) |
| 58 | self['borderwidth'] = 2 |
| 59 | self['relief'] = 'sunken' |
| 60 | self.parent = parent |
| 61 | self.action = action |
| 62 | self.current_key_sequences = current_key_sequences |
| 63 | self.result = '' |
| 64 | self.key_string = StringVar(self) |
| 65 | self.key_string.set('') |
| 66 | # Set self.modifiers, self.modifier_label. |
| 67 | self.set_modifiers_for_platform() |
| 68 | self.modifier_vars = [] |
| 69 | for modifier in self.modifiers: |
| 70 | variable = StringVar(self) |
| 71 | variable.set('') |
| 72 | self.modifier_vars.append(variable) |
| 73 | self.advanced = False |
| 74 | self.create_widgets() |
| 75 | |
| 76 | def showerror(self, *args, **kwargs): |
| 77 | # Make testing easier. Replace in #30751. |
no test coverage detected