samrobertsmith at gmail.com
Sat Nov 5 03:05:19 CET 2005
Why the button of the following code does not work? Thanks!
from Tkinter import *
def __init__(self, master):
frame = Frame(master)
self.button = Button(frame, text="QUIT", fg="red", command=frame.quit)
self.hi_there = Button(frame, text="Hello", command=self.say_hi)
print "hi there, everyone!"
root = Tk()
app = App(root)
On 11/4/05, Hugo González Monteverde <hugonz-lists at h-lab.net> wrote:
> pack is a method of Tkinter widget that needs to be called in order to
> have it displayed with the current geometry manager(which per default is
> the pack method)
> A geometry manager is just a way for arranging widgets into a window.
> Another geometry manager is "grid"
> If you don't specify anything, the widget will simply not be displayed..
> see here:
> Shi Mu wrote:
> > what does pack mean in the following code?
> > # File: hello1.py
> > from Tkinter import *
> > root = Tk()
> > w = Label(root, text="Hello, world!")
> > w.pack()
> > root.mainloop()
> > _______________________________________________
> > Tutor maillist - Tutor at python.org
> > http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor