bpo-33987: IDLE - use ttk Frame for ttk widgets (GH-11395)
diff --git a/Lib/idlelib/grep.py b/Lib/idlelib/grep.py
index 8cc293c..873233e 100644
--- a/Lib/idlelib/grep.py
+++ b/Lib/idlelib/grep.py
@@ -8,7 +8,7 @@
import sys
from tkinter import StringVar, BooleanVar
-from tkinter.ttk import Checkbutton
+from tkinter.ttk import Checkbutton # Frame imported in ...Base
from idlelib.searchbase import SearchDialogBase
from idlelib import searchengine
@@ -173,15 +173,18 @@
def _grep_dialog(parent): # htest #
from tkinter import Toplevel, Text, SEL, END
- from tkinter.ttk import Button
+ from tkinter.ttk import Frame, Button
from idlelib.pyshell import PyShellFileList
+
top = Toplevel(parent)
top.title("Test GrepDialog")
x, y = map(int, parent.geometry().split('+')[1:])
top.geometry(f"+{x}+{y + 175}")
flist = PyShellFileList(top)
- text = Text(top, height=5)
+ frame = Frame(top)
+ frame.pack()
+ text = Text(frame, height=5)
text.pack()
def show_grep_dialog():
@@ -189,7 +192,7 @@
grep(text, flist=flist)
text.tag_remove(SEL, "1.0", END)
- button = Button(top, text="Show GrepDialog", command=show_grep_dialog)
+ button = Button(frame, text="Show GrepDialog", command=show_grep_dialog)
button.pack()
if __name__ == "__main__":