When a Tkinter window comes up that uses tkSimpleDialog to construct a dialog box, the window first flashes on the screen as an unpopulated top-level window, before being drawn in its completed state. This problem is easily corrected by adding two lines of code to the constructor for class Dialog in tkSimpleDialog.py. The first line of the constructor reads Toplevel.__init__( self, parent ). After this line insert self.overrideredirect( True ). The second line from the last in this constructor reads self.initial_focus.focus_set(), just before this line insert self.overrideredirect( False). That's it. I've attached the revised version of this file.
Isn't overrideredirect only used to enable/disable borders in the window ? Why doing this fix what you described ? Also, make a patch against python-trunk instead of sending the entire file.
Correct. overrideredirect only enables/disables borders. However, what appears as a "flash" when the dialog box first appears is actually a window with only borders being drawn (no contents). Disabling borders BEFORE drawing anything prevents this "flash". I cannot say if this "flash" occurs on all platforms, but it does occur on all windows XP platforms that I've tried it on. In each of these cases the "fixed" tkSimpleDialog.py prevents this "flash". While not vital to application reliability, this fix does make applications appear more professional.