Get rid of toplevel tk panewindow while usong tkMessageBox
Question
When I do :
tkMessageBox.askquestion(title="Symbol Display",message="Is the symbol visible on the console")
along with Symbol Display window tk window is also coming.
If i press "Yes"...the child window return yes,whereas tk window remains there.
Whenever I am tryng to close tk window, End Program - tk comes. on pushing "End Now" button "pythonw.exe" window comes asking to send error report or not.
Why is it so ? How can I avoid tk window from popping out without affecting my script execution ???
Solution
The trick is to invoke withdraw on the Tk root top-level:
>>> import tkMessageBox, Tkinter
>>> Tkinter.Tk().withdraw()
>>> tkMessageBox.askquestion(
... title="Symbol Display",
... message="Is the symbol visible on the console")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow