GUI problems

James Logajan JamesL at Lugoj.Com
Thu Jul 5 19:21:41 EDT 2001


eric_brake wrote:
> 
> Why doesn't this TKinter script work? The blank window will come up,
> but the "quit" button doesn't appear inside it. Thanks for any help.
> 
> import dice_gui #ignore this
> from Tkinter import *
> class fibon_gui:
>      def __init__(self, master):
>           frame = Frame(master)
>           frame.pack()
>           button = Button(frame, text="QUIT", fg="red",
> command=frame.quit)
>           button.pack(side=LEFT)
> root = Tk()
> root.title('Play Dice')
> root.mainloop()

You are missing a line. Before root.mainloop(), add the line:

x = fibon_gui(root)

Otherwise you aren't creating any instance of class fibon_gui that I can
see!



More information about the Python-list mailing list