Display search test box.
(parent)
| 133 | |
| 134 | |
| 135 | def _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 | |
| 160 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected
searching dependent graphs…