diff options
author | Guilherme Polo <ggpolo@gmail.com> | 2009-03-07 02:14:38 (GMT) |
---|---|---|
committer | Guilherme Polo <ggpolo@gmail.com> | 2009-03-07 02:14:38 (GMT) |
commit | 15d57653f1ef6f7b5321c50e3bf03994d0428497 (patch) | |
tree | f0b3569cd42efa64c978c94b82a11993ae0cbeea /Lib | |
parent | 3768b2f4ce6660485399425aa09fbf6381900259 (diff) | |
download | cpython-15d57653f1ef6f7b5321c50e3bf03994d0428497.zip cpython-15d57653f1ef6f7b5321c50e3bf03994d0428497.tar.gz cpython-15d57653f1ef6f7b5321c50e3bf03994d0428497.tar.bz2 |
Fixed issue #2638: Show a window constructed with tkSimpleDialog.Dialog only
after it is has been populated and properly configured in order to prevent
window flashing.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/lib-tk/tkSimpleDialog.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/lib-tk/tkSimpleDialog.py b/Lib/lib-tk/tkSimpleDialog.py index 6948a49..8c583db 100644 --- a/Lib/lib-tk/tkSimpleDialog.py +++ b/Lib/lib-tk/tkSimpleDialog.py @@ -46,6 +46,7 @@ class Dialog(Toplevel): ''' Toplevel.__init__(self, parent) + self.withdraw() # remain invisible for now # If the master is not viewable, don't # make the child transient, or else it # would be opened withdrawn @@ -65,8 +66,6 @@ class Dialog(Toplevel): self.buttonbox() - self.wait_visibility() # window needs to be visible for the grab - self.grab_set() if not self.initial_focus: self.initial_focus = self @@ -77,8 +76,13 @@ class Dialog(Toplevel): self.geometry("+%d+%d" % (parent.winfo_rootx()+50, parent.winfo_rooty()+50)) + self.deiconify() # become visibile now + self.initial_focus.focus_set() + # wait for window to appear on screen before calling grab_set + self.wait_visibility() + self.grab_set() self.wait_window(self) def destroy(self): |