Wait for visibility before setting a grab. Fixes #946153.

This commit is contained in:
Martin v. Löwis 2004-08-03 18:36:25 +00:00
parent f901abdd62
commit b217cd802e
3 changed files with 3 additions and 0 deletions

View File

@ -119,6 +119,7 @@ class FileDialog:
self.set_selection(default)
self.filter_command()
self.selection.focus_set()
self.top.wait_visibility() # window needs to be visible for the grab
self.top.grab_set()
self.how = None
self.master.mainloop() # Exited by self.quit(how)

View File

@ -64,6 +64,7 @@ class SimpleDialog:
widget.deiconify() # Become visible at the desired location
def go(self):
self.root.wait_visibility()
self.root.grab_set()
self.root.mainloop()
self.root.destroy()

View File

@ -61,6 +61,7 @@ class Dialog(Toplevel):
self.buttonbox()
self.wait_visibility() # window needs to be visible for the grab
self.grab_set()
if not self.initial_focus: