<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff><FONT face=Arial size=2>
<DIV>Oops!&nbsp; Here's the program:</DIV>
<DIV>---------------------------<BR>from Tkinter import 
*&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>root = Tk()<BR>z = Label(root, text="Hello 
World!")<BR>z.grid()<BR>root.mainloop()</DIV>
<DIV>------------------------------</DIV>
<DIV>&nbsp;</DIV>
<DIV>Jim</DIV>
<DIV></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=jmorcombe@westnet.com.au href="mailto:jmorcombe@westnet.com.au">Jim 
  Morcombe</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=tutor@python.org 
  href="mailto:tutor@python.org">python tutor mailing list</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, December 28, 2007 3:51 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [Tutor] Closing GUI 
program</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=Arial size=2>I have copied the following program.&nbsp; When I 
  run it, (By pressing F5 from IDLE),&nbsp;it displays the "Hello world" 
  message.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>When I close the window, the "Hello world" 
  message disappears, but it seems that the program is still running, because 
  when I close the shell, i get the message "The program is still running.&nbsp; 
  Do you want to kill it?"</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>How do I get the program to terminate when the 
  window is closed?</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Jim</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Tutor maillist&nbsp; 
  -&nbsp; 
Tutor@python.org<BR>http://mail.python.org/mailman/listinfo/tutor<BR></BLOCKQUOTE></BODY></HTML>