mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-37177: make IDLE's search dialogs transient (GH-13869)
This avoids the search dialogs being hidden behind the editor window.
This commit is contained in:
parent
de76c07a8c
commit
554450fb4e
3 changed files with 10 additions and 5 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
import unittest
|
||||
from test.support import requires
|
||||
from tkinter import Tk
|
||||
from tkinter import Text, Tk, Toplevel
|
||||
from tkinter.ttk import Frame
|
||||
from idlelib import searchengine as se
|
||||
from idlelib import searchbase as sdb
|
||||
|
@ -47,14 +47,15 @@ class SearchDialogBaseTest(unittest.TestCase):
|
|||
# open calls create_widgets, which needs default_command
|
||||
self.dialog.default_command = None
|
||||
|
||||
# Since text parameter of .open is not used in base class,
|
||||
# pass dummy 'text' instead of tk.Text().
|
||||
self.dialog.open('text')
|
||||
toplevel = Toplevel(self.root)
|
||||
self.addCleanup(toplevel.destroy)
|
||||
text = Text(toplevel)
|
||||
self.dialog.open(text)
|
||||
self.assertEqual(self.dialog.top.state(), 'normal')
|
||||
self.dialog.close()
|
||||
self.assertEqual(self.dialog.top.state(), 'withdrawn')
|
||||
|
||||
self.dialog.open('text', searchphrase="hello")
|
||||
self.dialog.open(text, searchphrase="hello")
|
||||
self.assertEqual(self.dialog.ent.get(), 'hello')
|
||||
self.dialog.close()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue