quit button

Discussion in 'Python' started by linda.s, Oct 25, 2009.

  1. linda.s

    linda.s Guest

    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()
     
    linda.s, Oct 25, 2009
    #1
    1. Advertising

  2. On 2009-10-25, linda.s <> wrote:

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


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

    --
    Grant
     
    Grant Edwards, Oct 25, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M. Duijkers
    Replies:
    2
    Views:
    483
    Joe Smith
    Dec 12, 2004
  2. Craig

    Postback quit working

    Craig, Sep 27, 2004, in forum: ASP .Net
    Replies:
    10
    Views:
    674
    Kikoz
    Sep 27, 2004
  3. GD
    Replies:
    2
    Views:
    371
  4. =?Utf-8?B?RXpoaWw=?=

    Could not quit MSACCESS.EXE

    =?Utf-8?B?RXpoaWw=?=, Dec 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    497
    Ken Cox [Microsoft MVP]
    Dec 27, 2004
  5. Boris
    Replies:
    2
    Views:
    380
    Eric Brunel
    Dec 4, 2007
Loading...

Share This Page