Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   quit button (http://www.velocityreviews.com/forums/t702840-quit-button.html)

linda.s 10-25-2009 02:59 AM

quit button
 
When I click "quit" button, why the following code has problem?

from Tkinter import *
colors = ['red', 'green', 'yellow', 'orange', 'blue', 'navy']

def gridbox(parent):
r = 0
for c in colors:
l = Label(parent, text=c, relief=RIDGE, width=25)
e = Entry(parent, bg=c, relief=SUNKEN, width=50)
l.grid(row=r, column=0)
e.grid(row=r, column=1)
r = r+1

def packbox(parent):
for c in colors:
f = Frame(parent)
l = Label(f, text=c, relief=RIDGE, width=25)
e = Entry(f, bg=c, relief=SUNKEN, width=50)
f.pack(side=TOP)
l.pack(side=LEFT)
e.pack(side=RIGHT)

if __name__ == '__main__':
root = Tk()
gridbox(Toplevel())
packbox(Toplevel())
Button(root, text='Quit', command=root.quit).pack()
mainloop()

Grant Edwards 10-25-2009 03:35 PM

Re: quit button
 
On 2009-10-25, linda.s <samrobertsmith@gmail.com> wrote:

> When I click "quit" button, why the following code has problem?


It works fine for me (running Gentoo Linux on IA32).

--
Grant



All times are GMT. The time now is 02:35 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.