diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-27 03:30:54 -0400 |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-27 03:30:54 -0400 |
commit | 0a4d13e87e0272085ed920b284f7245f01137cb3 (patch) | |
tree | ed71eb2dca6a3e61b9cc76f065bbcaea44ca25a6 /Lib/idlelib/SearchDialog.py | |
parent | aa7886dd3fd56f02a4f5ef239c869e97cbde4a57 (diff) | |
download | cpython-git-0a4d13e87e0272085ed920b284f7245f01137cb3.tar.gz |
Issue #21477: Add htests for Search and Replace dialogs.
Patch by Saimadhav Heblikar.
Diffstat (limited to 'Lib/idlelib/SearchDialog.py')
-rw-r--r-- | Lib/idlelib/SearchDialog.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Lib/idlelib/SearchDialog.py b/Lib/idlelib/SearchDialog.py index bf76c419ac..38408b8dea 100644 --- a/Lib/idlelib/SearchDialog.py +++ b/Lib/idlelib/SearchDialog.py @@ -65,3 +65,25 @@ class SearchDialog(SearchDialogBase): if pat: self.engine.setcookedpat(pat) return self.find_again(text) + +def _search_dialog(parent): + root = Tk() + root.title("Test SearchDialog") + width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) + root.geometry("+%d+%d"%(x, y + 150)) + text = Text(root) + text.pack() + text.insert("insert","This is a sample string.\n"*10) + + def show_find(): + text.tag_add(SEL, "1.0", END) + s = _setup(text) + s.open(text) + text.tag_remove(SEL, "1.0", END) + + button = Button(root, text="Search", command=show_find) + button.pack() + +if __name__ == '__main__': + from idlelib.idle_test.htest import run + run(_search_dialog) |