Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[3.15] gh-159517: Modernize tkinter.simpledialog (GH-159518)
gh-159517: Modernize tkinter.simpledialog

No longer call ::tk::unsupported::MacWindowStyle on Tcl 9.1 and
newer.
(cherry picked from commit 173dabe)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
  • Loading branch information
2 people authored and miss-islington committed Oct 16, 2026
commit b82e7cc3b9978bf78a34a6e38e20d12df9bc9a22
7 changes: 5 additions & 2 deletions Lib/tkinter/simpledialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,11 @@ def _place_window(w, parent=None):

def _setup_dialog(w):
if w._windowingsystem == "aqua":
w.tk.call("::tk::unsupported::MacWindowStyle", "style",
w, "moveableModal", "")
if w.info_patchlevel() >= (9, 1):
w.wm_attributes(stylemask='titled')
else:
w.tk.call('::tk::unsupported::MacWindowStyle', 'style',
w, 'moveableModal', '')
elif w._windowingsystem == "x11":
w.wm_attributes(type="dialog")

Expand Down
Loading