Newbie Q: Missing Frame

engsol at teleport.com engsol at teleport.com
Thu Jul 26 13:49:49 EDT 2001


When I run the following code, I see a large window, with two frames,
the blue on top, and the yellow on the bottom.

 When I attempt to add a label to frame 2 , (by removing the #'s), I
still see the blue frame, but the yellow frame is missing, and just
the label is showing in it's place.

Running on NT4, Python versions 1.5+ and 2.0

Any help appreciated.
Engsol

PS..is there a way to break out of "mainloop" via a button command,
and run the code subsequent to the GUI code?


***** Start sample code ******

from Tkinter import *
win = Tk()

def test():

  frame_1 = Frame(win, width = 500, height = 100, bg = 'blue')
  frame_1.pack()

  frame_2 = Frame(win, width = 500, height = 100, bg = 'yellow')
  frame_2.pack()

  # label_1 = Label(frame_2, text = "Will this work?", bg = 'red')
  #label_1.pack()

  win.mainloop()

test()

**** End sample code ****




More information about the Python-list mailing list