mirror of
https://github.com/python/cpython.git
synced 2025-11-02 14:41:33 +00:00
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.
This commit is contained in:
parent
3768b2f4ce
commit
15d57653f1
2 changed files with 10 additions and 2 deletions
|
|
@ -46,6 +46,7 @@ def __init__(self, parent, title = None):
|
|||
'''
|
||||
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 @@ def __init__(self, parent, title = None):
|
|||
|
||||
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 @@ def __init__(self, parent, title = None):
|
|||
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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue