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

Function _grep_dialog

Lib/idlelib/grep.py:192–215  ·  view source on GitHub ↗
(parent)

Source from the content-addressed store, hash-verified

190
191
192def _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
218if __name__ == "__main__":

Callers

nothing calls this directly

Calls 9

insertMethod · 0.95
ToplevelClass · 0.90
PyShellFileListClass · 0.90
FrameClass · 0.90
TextClass · 0.90
ButtonClass · 0.90
titleMethod · 0.45
splitMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…