(parent)
Display search test box.
Display search test box.
Display search test box .
def _search_dialog(parent):  # htest #
    "Display search test box."
    from tkinter import Toplevel, Text
    from tkinter.ttk import Frame, Button

    top = Toplevel(parent)
    top.title("Test SearchDialog")
    x, y = map(int, parent.geometry().split('+')[1:])
    top.geometry("+%d+%d" % (x, y + 175))

    frame = Frame(top)
    frame.pack()
    text = Text(frame, inactiveselectbackground='gray')
    text.pack()
    text.insert("insert","This is a sample string.\n"*5)

    def show_find():
        text.tag_add('sel', '1.0', 'end')
        _setup(text).open(text)
        text.tag_remove('sel', '1.0', 'end')

    button = Button(frame, text="Search (selection ignored)", command=show_find)
    button.pack()
def _search_dialog ( parent ) : # htest # from tkinter import Toplevel , Text from tkinter . ttk import Frame , Button top = Toplevel ( parent ) top . title ( "Test SearchDialog" ) x , y = map ( int , parent . geometry ( ) . split ( '+' ) [ 1 : ] ) top . geometry ( "+%d+%d" % ( x , y + 175 ) ) frame = Frame ( top ) frame . pack ( ) text = Text ( frame , inactiveselectbackground = 'gray' ) text . pack ( ) text . insert ( "insert" , "This is a sample string.\n" * 5 ) def show_find ( ) : text . tag_add ( 'sel' , '1.0' , 'end' ) _setup ( text ) . open ( text ) text . tag_remove ( 'sel' , '1.0' , 'end' ) button = Button ( frame , text = "Search (selection ignored)" , command = show_find ) button . pack ( )