Build the various widgets that will be used in the program.
(self)
| 46 | self.key = self.primer = None |
| 47 | |
| 48 | def build_widgets(self): |
| 49 | "Build the various widgets that will be used in the program." |
| 50 | # Create processing frame widgets. |
| 51 | self.processing_frame = LabelFrame(self, text='Processing Mode:') |
| 52 | self.mode_var = StringVar(self, 'encode') |
| 53 | self.decode_button = Radiobutton(self.processing_frame, |
| 54 | text='Decode Cipher-Text', |
| 55 | command=self.handle_radiobuttons, |
| 56 | value='decode', |
| 57 | variable=self.mode_var) |
| 58 | self.encode_button = Radiobutton(self.processing_frame, |
| 59 | text='Encode Plain-Text', |
| 60 | command=self.handle_radiobuttons, |
| 61 | value='encode', |
| 62 | variable=self.mode_var) |
| 63 | self.freeze_var = BooleanVar(self, False) |
| 64 | self.freeze_button = Checkbutton(self.processing_frame, |
| 65 | text='Freeze Key & Primer', |
| 66 | command=self.handle_checkbutton, |
| 67 | offvalue=False, |
| 68 | onvalue=True, |
| 69 | variable=self.freeze_var) |
| 70 | # Create encoding frame widgets. |
| 71 | self.encoding_frame = LabelFrame(self, text='Encoding Options:') |
| 72 | self.chain_size_label = Label(self.encoding_frame, text='Chain Size:') |
| 73 | self.chain_size_entry = Entry(self.encoding_frame) |
| 74 | self.plain_text_label = Label(self.encoding_frame, text='Plain-Text:') |
| 75 | self.plain_text_entry = Entry(self.encoding_frame) |
| 76 | # Create input frame widgets. |
| 77 | self.input_frame = LabelFrame(self, text='Input Area:') |
| 78 | self.input_text = ScrolledText(self.input_frame, **self.TEXT) |
| 79 | # Create output frame widgets. |
| 80 | self.output_frame = LabelFrame(self, text='Output Area:') |
| 81 | self.output_text = ScrolledText(self.output_frame, **self.TEXT) |
| 82 | |
| 83 | def place_widgets(self): |
| 84 | "Place the widgets where they belong in the MarkovDemo frame." |
no test coverage detected