(self)
| 78 | messagebox.showerror(*args, **kwargs) |
| 79 | |
| 80 | def create_widgets(self): |
| 81 | # Basic entry key sequence. |
| 82 | self.frame_keyseq_basic = Frame(self, name='keyseq_basic') |
| 83 | self.frame_keyseq_basic.grid(row=0, column=0, sticky='nsew', |
| 84 | padx=5, pady=5) |
| 85 | basic_title = Label(self.frame_keyseq_basic, |
| 86 | text=f"New keys for '{self.action}' :") |
| 87 | basic_title.pack(anchor='w') |
| 88 | |
| 89 | basic_keys = Label(self.frame_keyseq_basic, justify='left', |
| 90 | textvariable=self.key_string, relief='groove', |
| 91 | borderwidth=2) |
| 92 | basic_keys.pack(ipadx=5, ipady=5, fill='x') |
| 93 | |
| 94 | # Basic entry controls. |
| 95 | self.frame_controls_basic = Frame(self) |
| 96 | self.frame_controls_basic.grid(row=1, column=0, sticky='nsew', padx=5) |
| 97 | |
| 98 | # Basic entry modifiers. |
| 99 | self.modifier_checkbuttons = {} |
| 100 | column = 0 |
| 101 | for modifier, variable in zip(self.modifiers, self.modifier_vars): |
| 102 | label = self.modifier_label.get(modifier, modifier) |
| 103 | check = Checkbutton(self.frame_controls_basic, |
| 104 | command=self.build_key_string, text=label, |
| 105 | variable=variable, onvalue=modifier, offvalue='') |
| 106 | check.grid(row=0, column=column, padx=2, sticky='w') |
| 107 | self.modifier_checkbuttons[modifier] = check |
| 108 | column += 1 |
| 109 | |
| 110 | # Basic entry help text. |
| 111 | help_basic = Label(self.frame_controls_basic, justify='left', |
| 112 | text="Select the desired modifier keys\n"+ |
| 113 | "above, and the final key from the\n"+ |
| 114 | "list on the right.\n\n" + |
| 115 | "Use upper case Symbols when using\n" + |
| 116 | "the Shift modifier. (Letters will be\n" + |
| 117 | "converted automatically.)") |
| 118 | help_basic.grid(row=1, column=0, columnspan=4, padx=2, sticky='w') |
| 119 | |
| 120 | # Basic entry key list. |
| 121 | self.list_keys_final = Listbox(self.frame_controls_basic, width=15, |
| 122 | height=10, selectmode='single') |
| 123 | self.list_keys_final.insert('end', *AVAILABLE_KEYS) |
| 124 | self.list_keys_final.bind('<ButtonRelease-1>', self.final_key_selected) |
| 125 | self.list_keys_final.grid(row=0, column=4, rowspan=4, sticky='ns') |
| 126 | scroll_keys_final = Scrollbar(self.frame_controls_basic, |
| 127 | orient='vertical', |
| 128 | command=self.list_keys_final.yview) |
| 129 | self.list_keys_final.config(yscrollcommand=scroll_keys_final.set) |
| 130 | scroll_keys_final.grid(row=0, column=5, rowspan=4, sticky='ns') |
| 131 | self.button_clear = Button(self.frame_controls_basic, |
| 132 | text='Clear Keys', |
| 133 | command=self.clear_key_seq) |
| 134 | self.button_clear.grid(row=2, column=0, columnspan=4) |
| 135 | |
| 136 | # Advanced entry key sequence. |
| 137 | self.frame_keyseq_advanced = Frame(self, name='keyseq_advanced') |
no test coverage detected