diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2016-07-11 00:21:31 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2016-07-11 00:21:31 (GMT) |
commit | 6f7b0f577ea16df0b9bc3ee2a66fd668e83414eb (patch) | |
tree | 872fbd1843abbdbd257b310cf094d7c489e21ca2 /Lib/idlelib/search.py | |
parent | a748032653aec69596257f59f27d8e1945fece9d (diff) | |
download | cpython-6f7b0f577ea16df0b9bc3ee2a66fd668e83414eb.zip cpython-6f7b0f577ea16df0b9bc3ee2a66fd668e83414eb.tar.gz cpython-6f7b0f577ea16df0b9bc3ee2a66fd668e83414eb.tar.bz2 |
Issue #27477: Convert IDLE search dialogs to using ttk widgets.
Diffstat (limited to 'Lib/idlelib/search.py')
-rw-r--r-- | Lib/idlelib/search.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/idlelib/search.py b/Lib/idlelib/search.py index 17a9ef3..4c2acef 100644 --- a/Lib/idlelib/search.py +++ b/Lib/idlelib/search.py @@ -1,4 +1,4 @@ -from tkinter import * +from tkinter import TclError from idlelib import searchengine from idlelib.searchbase import SearchDialogBase @@ -72,7 +72,10 @@ class SearchDialog(SearchDialogBase): def _search_dialog(parent): # htest # - '''Display search test box.''' + "Display search test box." + from tkinter import Toplevel, Text + from tkinter.ttk import Button + box = Toplevel(parent) box.title("Test SearchDialog") x, y = map(int, parent.geometry().split('+')[1:]) @@ -82,9 +85,9 @@ def _search_dialog(parent): # htest # text.insert("insert","This is a sample string.\n"*5) def show_find(): - text.tag_add(SEL, "1.0", END) + text.tag_add('sel', '1.0', 'end') _setup(text).open(text) - text.tag_remove(SEL, "1.0", END) + text.tag_remove('sel', '1.0', 'end') button = Button(box, text="Search (selection ignored)", command=show_find) button.pack() |