Tkinter tkMessageBox problem - message box is displayed with an additional window

dudeja.rajat at gmail.com dudeja.rajat at gmail.com
Thu Aug 28 09:29:29 EDT 2008


Hi,
I'm working on Windows Platform

I'm facing some problem with the tkMessageBox. My code is as below:

import tkMessageBox
import Tix
from Tkinter import *

if len(installedLibPath) != len(listOfLibraries):
        if tkMessageBox.askyesno("Question", \
                                 type='yesno', icon='warning', \
                                 message="Some of the libraries are
not installed. Do you wish to continue with the remaining?"):
        myRoot = Tix.Tk()
        myAppGUIObject = myAppGUI(myRoot)    #Class for my GUI
        myRoot.mainloop()
else:
        sys.exit(0)


The Message Box is called before the Tix.Tk mainloop(). The problems
are as under :

1. Since the message box is displayed before the mainloop() is
started, the message box is displayed with another window that is
blank. This should not be displayed.

2. As a results of this messagebox (called before the mainloop) the
original Gui started by mainloop doesnot work as desired. Some of the
checkbuttons are displayed as unset (i.e un-ticked). These
checkbuttons used to be set at initialization before I stared using
this messagebox.


Please help.

Thanks and regards,
Rajat
-- 
Regrads,
Rajat



More information about the Python-list mailing list