(parent)
| 190 | |
| 191 | |
| 192 | def _grep_dialog(parent): # htest # |
| 193 | from tkinter import Toplevel, Text, SEL |
| 194 | from tkinter.ttk import Frame, Button |
| 195 | from idlelib.pyshell import PyShellFileList |
| 196 | |
| 197 | top = Toplevel(parent) |
| 198 | top.title("Test GrepDialog") |
| 199 | x, y = map(int, parent.geometry().split('+')[1:]) |
| 200 | top.geometry(f"+{x}+{y + 175}") |
| 201 | |
| 202 | flist = PyShellFileList(top) |
| 203 | frame = Frame(top) |
| 204 | frame.pack() |
| 205 | text = Text(frame, height=5) |
| 206 | text.pack() |
| 207 | text.insert('1.0', 'import grep') |
| 208 | |
| 209 | def show_grep_dialog(): |
| 210 | text.tag_add(SEL, "1.0", '1.end') |
| 211 | grep(text, flist=flist) |
| 212 | text.tag_remove(SEL, "1.0", '1.end') |
| 213 | |
| 214 | button = Button(frame, text="Show GrepDialog", command=show_grep_dialog) |
| 215 | button.pack() |
| 216 | |
| 217 | |
| 218 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected
searching dependent graphs…