summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/simpledialog.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/tkinter/simpledialog.py')
-rw-r--r--Lib/tkinter/simpledialog.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/tkinter/simpledialog.py b/Lib/tkinter/simpledialog.py
index a66fbd6..538bbfc 100644
--- a/Lib/tkinter/simpledialog.py
+++ b/Lib/tkinter/simpledialog.py
@@ -40,6 +40,9 @@ class SimpleDialog:
if title:
self.root.title(title)
self.root.iconname(title)
+
+ _setup_dialog(self.root)
+
self.message = Message(self.root, text=text, aspect=400)
self.message.pack(expand=1, fill=BOTH)
self.frame = Frame(self.root)
@@ -115,6 +118,8 @@ class Dialog(Toplevel):
if title:
self.title(title)
+ _setup_dialog(self)
+
self.parent = parent
self.result = None
@@ -252,6 +257,13 @@ def _place_window(w, parent=None):
w.wm_deiconify() # Become visible at the desired location
+def _setup_dialog(w):
+ if w._windowingsystem == "aqua":
+ w.tk.call("::tk::unsupported::MacWindowStyle", "style",
+ w, "moveableModal", "")
+ elif w._windowingsystem == "x11":
+ w.wm_attributes("-type", "dialog")
+
# --------------------------------------------------------------------
# convenience dialogues