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

Function _search_dialog

Lib/idlelib/search.py:135–157  ·  view source on GitHub ↗

Display search test box.

(parent)

Source from the content-addressed store, hash-verified

133
134
135def _search_dialog(parent): # htest #
136 "Display search test box."
137 from tkinter import Toplevel, Text
138 from tkinter.ttk import Frame, Button
139
140 top = Toplevel(parent)
141 top.title("Test SearchDialog")
142 x, y = map(int, parent.geometry().split('+')[1:])
143 top.geometry("+%d+%d" % (x, y + 175))
144
145 frame = Frame(top)
146 frame.pack()
147 text = Text(frame, inactiveselectbackground='gray')
148 text.pack()
149 text.insert("insert","This is a sample string.\n"*5)
150
151 def show_find():
152 text.tag_add('sel', '1.0', 'end')
153 _setup(text).open(text)
154 text.tag_remove('sel', '1.0', 'end')
155
156 button = Button(frame, text="Search (selection ignored)", command=show_find)
157 button.pack()
158
159
160if __name__ == '__main__':

Callers

nothing calls this directly

Calls 8

insertMethod · 0.95
ToplevelClass · 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…