diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-04-25 10:07:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-25 10:07:58 (GMT) |
commit | 3bb3fb3be09d472a43cdc3d9d9578bd49f3dfb8c (patch) | |
tree | 683c7ba6c3fd9fe0899fba5254fb7a6b6193386a /Lib/idlelib | |
parent | 8cc3cfa8afab1651c4f6e9ba43a7ab7f10f64c32 (diff) | |
download | cpython-3bb3fb3be09d472a43cdc3d9d9578bd49f3dfb8c.zip cpython-3bb3fb3be09d472a43cdc3d9d9578bd49f3dfb8c.tar.gz cpython-3bb3fb3be09d472a43cdc3d9d9578bd49f3dfb8c.tar.bz2 |
bpo-43655: Tkinter and IDLE dialog windows are now recognized as dialogs by window managers on macOS and X Window (#25187)
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/config_key.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/query.py | 10 | ||||
-rw-r--r-- | Lib/idlelib/searchbase.py | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/Lib/idlelib/config_key.py b/Lib/idlelib/config_key.py index 7510aa9..9ca3a15 100644 --- a/Lib/idlelib/config_key.py +++ b/Lib/idlelib/config_key.py @@ -4,6 +4,7 @@ Dialog for building Tkinter accelerator key bindings from tkinter import Toplevel, Listbox, StringVar, TclError from tkinter.ttk import Frame, Button, Checkbutton, Entry, Label, Scrollbar from tkinter import messagebox +from tkinter.simpledialog import _setup_dialog import string import sys @@ -63,6 +64,7 @@ class GetKeysDialog(Toplevel): self.resizable(height=False, width=False) self.title(title) self.transient(parent) + _setup_dialog(self) self.grab_set() self.protocol("WM_DELETE_WINDOW", self.cancel) self.parent = parent diff --git a/Lib/idlelib/query.py b/Lib/idlelib/query.py index 015fc7a..fefa5aa 100644 --- a/Lib/idlelib/query.py +++ b/Lib/idlelib/query.py @@ -28,6 +28,7 @@ from tkinter import Toplevel, StringVar, BooleanVar, W, E, S from tkinter.ttk import Frame, Button, Entry, Label, Checkbutton from tkinter import filedialog from tkinter.font import Font +from tkinter.simpledialog import _setup_dialog class Query(Toplevel): """Base class for getting verified answer from a user. @@ -60,13 +61,8 @@ class Query(Toplevel): if not _utest: # Otherwise fail when directly run unittest. self.grab_set() - windowingsystem = self.tk.call('tk', 'windowingsystem') - if windowingsystem == 'aqua': - try: - self.tk.call('::tk::unsupported::MacWindowStyle', 'style', - self._w, 'moveableModal', '') - except: - pass + _setup_dialog(self) + if self._windowingsystem == 'aqua': self.bind("<Command-.>", self.cancel) self.bind('<Key-Escape>', self.cancel) self.protocol("WM_DELETE_WINDOW", self.cancel) diff --git a/Lib/idlelib/searchbase.py b/Lib/idlelib/searchbase.py index fbef87a..64ed50c 100644 --- a/Lib/idlelib/searchbase.py +++ b/Lib/idlelib/searchbase.py @@ -2,6 +2,7 @@ from tkinter import Toplevel from tkinter.ttk import Frame, Entry, Label, Button, Checkbutton, Radiobutton +from tkinter.simpledialog import _setup_dialog class SearchDialogBase: @@ -83,6 +84,7 @@ class SearchDialogBase: top.protocol("WM_DELETE_WINDOW", self.close) top.wm_title(self.title) top.wm_iconname(self.icon) + _setup_dialog(top) self.top = top self.frame = Frame(top, padding="5px") self.frame.grid(sticky="nwes") |