"Coral Snake" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> ---------------------------------------------------------- > Tkinter: > > from Tkinter import * > root = Tk() This creates the application's main window. The Tk() command is not some kind of initialization routine, but actually returns a ready to use toplevel widget. > win = Toplevel(root) This creates a child window with the parent "root"; > win.pack() here you try to put the child window into the main window; this cannot work, because a Tk() or Toplevel() window cannot contain other Toplevel() instances. Toplevel() is used for things like dialogs. If you need a separate container widget inside "root" use Frame() instead. > Label(win, text= "Hello, Python World").pack(side=TOP) > Button(win, text= "Close", command=win.quit).pack(side=RIGHT) > win.mainloop() > --------------------------------------------------------- > > AttributeError: Toplevel instance has no attribute 'pack' > > --------------------------------------------------------- The correct usage of what you tried looks like this: from Tkinter import * root = Tk() Label(win, text= "Hello, Python World").pack(side=TOP) Button(win, text= "Close", command=win.quit).pack(side=RIGHT) root.mainloop() I hope this helps Michael -- http://mail.python.org/mailman/listinfo/python-list