[Tutor] Dialog box under windows

m.evanetich at att.net m.evanetich at att.net
Thu Jan 8 12:43:04 EST 2004

> On Thu, Jan 08, 2004 at 03:46:03PM -0000, Edward Comber wrote:
> > Thanks very much for that, I'll get stuck into it. At the moment it
> > opens a Tk main app screen that can't be closed but I'll persist.
> Not if you already have a main window open. It's not meant to be used
> standalone but as part of an application.
I dealt with this, thanks to suggestions on this list by writing my own 
little modeule that calls these TK dialogs and withdraws the top level main 
app.  Since I use these things in scripts, that seems to work pretty well.
Here is an example:

import Tkinter
import tkMessageBox
def InfoBox(Title=None, Message=None):

    root =Tkinter.Tk()
    root.withdraw()     # Prevent spurious root window from showing
    message = tkMessageBox.showinfo(title=Title, message=Message)
    return message

Best wishes,

More information about the Tutor mailing list