Tkinter hangs again under Windows

Ivan Van Laningham ivanlan at callware.com
Wed Jan 19 09:04:12 EST 2000


Hi All--

Hans-Joachim Widmaier wrote:
> 
> Niels Diepeveen wrote:
> 
> > This seems to be the problem. If you show any dialogs before entering
> > mainloop, you won't receive events anymore.
> 
> Apparently this is the case. Is this a (known?) bug or just an undocumented
> feature, or is it even documented? The problem seems to only exist under
> Windows.
> 
> Thanks a lot. I'll find a way around it, probably a self.after() that
> shows the dialogue shortly after entering the mainloop.
> 

Use the tkMessageBox functions:
----------------------------------
root=Tk()
..
..
tkMessageBox.showwarning("Bad filename",
            ("Can't open file %s" % (sys.argv[1])),parent=root)
----------------------------------

I.e., go ahead and create your main window, and _then_ put up a dialog
box.  If you specify the "parent=root" option, everything will work just
fine.  If you don't specify it, you're hosed.

<some-hoses-stop-the-flow>-ly y'rs,
Ivan
----------------------------------------------
Ivan Van Laningham
Callware Technologies, Inc.
ivanlan at callware.com
ivanlan at home.com
http://www.pauahtun.org
See also: 
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
Author:  Teach Yourself Python in 24 Hours
----------------------------------------------




More information about the Python-list mailing list