|
8 | 8 | import sys |
9 | 9 |
|
10 | 10 | from tkinter import StringVar, BooleanVar |
11 | | -from tkinter.ttk import Checkbutton |
| 11 | +from tkinter.ttk import Checkbutton # Frame imported in ...Base |
12 | 12 |
|
13 | 13 | from idlelib.searchbase import SearchDialogBase |
14 | 14 | from idlelib import searchengine |
@@ -173,23 +173,26 @@ def findfiles(self, dir, base, rec): |
173 | 173 |
|
174 | 174 | def _grep_dialog(parent): # htest # |
175 | 175 | from tkinter import Toplevel, Text, SEL, END |
176 | | - from tkinter.ttk import Button |
| 176 | + from tkinter.ttk import Frame, Button |
177 | 177 | from idlelib.pyshell import PyShellFileList |
| 178 | + |
178 | 179 | top = Toplevel(parent) |
179 | 180 | top.title("Test GrepDialog") |
180 | 181 | x, y = map(int, parent.geometry().split('+')[1:]) |
181 | 182 | top.geometry(f"+{x}+{y + 175}") |
182 | 183 |
|
183 | 184 | flist = PyShellFileList(top) |
184 | | - text = Text(top, height=5) |
| 185 | + frame = Frame(top) |
| 186 | + frame.pack() |
| 187 | + text = Text(frame, height=5) |
185 | 188 | text.pack() |
186 | 189 |
|
187 | 190 | def show_grep_dialog(): |
188 | 191 | text.tag_add(SEL, "1.0", END) |
189 | 192 | grep(text, flist=flist) |
190 | 193 | text.tag_remove(SEL, "1.0", END) |
191 | 194 |
|
192 | | - button = Button(top, text="Show GrepDialog", command=show_grep_dialog) |
| 195 | + button = Button(frame, text="Show GrepDialog", command=show_grep_dialog) |
193 | 196 | button.pack() |
194 | 197 |
|
195 | 198 | if __name__ == "__main__": |
|
0 commit comments