MCPcopy Index your code
hub / github.com/python/cpython / create_widgets

Method create_widgets

Lib/idlelib/searchbase.py:75–101  ·  view source on GitHub ↗

Create basic 3 row x 3 col search (find) dialog. Other dialogs override subsidiary create_x methods as needed. Replace and Find-in-Files add another entry row.

(self)

Source from the content-addressed store, hash-verified

73 self.top.withdraw()
74
75 def create_widgets(self):
76 '''Create basic 3 row x 3 col search (find) dialog.
77
78 Other dialogs override subsidiary create_x methods as needed.
79 Replace and Find-in-Files add another entry row.
80 '''
81 top = Toplevel(self.root)
82 top.bind("<Return>", self.default_command)
83 top.bind("<Escape>", self.close)
84 top.protocol("WM_DELETE_WINDOW", self.close)
85 top.wm_title(self.title)
86 top.wm_iconname(self.icon)
87 _setup_dialog(top)
88 self.top = top
89 self.frame = Frame(top, padding=5)
90 self.frame.grid(sticky="nwes")
91 top.grid_columnconfigure(0, weight=100)
92 top.grid_rowconfigure(0, weight=100)
93
94 self.row = 0
95 self.frame.grid_columnconfigure(0, pad=2, weight=0)
96 self.frame.grid_columnconfigure(1, pad=2, minsize=100, weight=100)
97
98 self.create_entries() # row 0 (and maybe 1), cols 0, 1
99 self.create_option_buttons() # next row, cols 0, 1
100 self.create_other_buttons() # next row, cols 0, 1
101 self.create_command_buttons() # col 2, all rows
102
103 def make_entry(self, label_text, var):
104 ''&#x27;Return (entry, label), .

Callers 2

openMethod · 0.95
__init__Method · 0.45

Calls 14

create_entriesMethod · 0.95
create_option_buttonsMethod · 0.95
create_other_buttonsMethod · 0.95
ToplevelClass · 0.90
_setup_dialogFunction · 0.90
FrameClass · 0.90
protocolMethod · 0.80
wm_titleMethod · 0.80
wm_iconnameMethod · 0.80
grid_columnconfigureMethod · 0.80
grid_rowconfigureMethod · 0.80

Tested by

no test coverage detected