MCPcopy Create free account
hub / github.com/ActiveState/code / build_widgets

Method build_widgets

recipes/Python/578076_Markov/recipe-578076.py:48–81  ·  view source on GitHub ↗

Build the various widgets that will be used in the program.

(self)

Source from the content-addressed store, hash-verified

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."

Callers 1

__init__Method · 0.95

Calls 6

LabelFrameClass · 0.85
RadiobuttonClass · 0.85
CheckbuttonClass · 0.85
LabelClass · 0.85
EntryClass · 0.50
ScrolledTextClass · 0.50

Tested by

no test coverage detected