Skip to content

Commit 173dabe

Browse files
[3.15] gh-159517: Modernize tkinter.simpledialog (#159518)
gh-159517: Modernize tkinter.simpledialog No longer call ::tk::unsupported::MacWindowStyle on Tcl 9.1 and newer. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent b65c01c commit 173dabe

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎Lib/tkinter/simpledialog.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,11 @@ def _place_window(w, parent=None):
262262

263263
def _setup_dialog(w):
264264
if w._windowingsystem == "aqua":
265-
w.tk.call("::tk::unsupported::MacWindowStyle", "style",
266-
w, "moveableModal", "")
265+
if w.info_patchlevel() >= (9, 1):
266+
w.wm_attributes(stylemask='titled')
267+
else:
268+
w.tk.call('::tk::unsupported::MacWindowStyle', 'style',
269+
w, 'moveableModal', '')
267270
elif w._windowingsystem == "x11":
268271
w.wm_attributes(type="dialog")
269272

0 commit comments

Comments
 (0)