Simple problem with GUI!!

mohan mohan.us2010 at gmail.com
Fri Oct 27 05:08:26 EDT 2006


Hello Guys,

I am a beginner with Python programming and would like to implement
some GUI functionalities along with my main work. So I was trying to
implement one basic program (available from books).
Here is the code,

############################
import Tkinter

TopLevelWindowObj = Tkinter.Tk() # Creating a root window
QuitObj = Tkinter.Button(TopLevelWindowObj, text = "QUIT", command =
TopLevelWindowObj.quit) #  Creating a Button
QuitObj.pack() # Positioning the button
Tkinter.mainloop()
#############################

So, this is a code to display a window with a "QUIT" button and by
clickign the button the entire window is closed. When I execute this
program, the window does not close down but the window is completely
disabled and after a few seconds I get the following message in a
message window,

**************************************************************************
Message box name - Microsoft Visual C++ Runtime Library

Runtime Error!

program...\Python22\core\lib\site-packages\Pythonwin\Pythonwin.exe

This application has requested the Runtime to terminate it in an
unusual way.
Please contact the application's support team for more information.

************************************************************************************
At the end I had to close down my entire python compiler. I am using
Python compiler with following specs in Windows XP OS.

Pythonwin - Python IDE and GUI Framework for Windows.
PythonWin 2.2.1 (#34, Feb 25 2003, 11:29:09) [MSC 32 bit (Intel)] on
win32.
Portions Copyright 1994-2001 Mark Hammond

Please let me know why is this happening and also if I am missing
something in the way of programming.

Thanks in advance.

Cheers,
Mohan.




More information about the Python-list mailing list