Newbie Q: Missing Frame

Michele Rosen michele_rosen at yahoo.com
Thu Jul 26 18:48:03 EDT 2001


I'm not sure why this is happening, but one way to
avoid this would be to use grid instead of pack and
specify the row and column where you want the frames
and label to appear...

M

Message: 17
   Date: Thu, 26 Jul 2001 17:49:49 GMT
   From: engsol at teleport.com
Subject: Newbie Q: Missing Frame

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 ****





=====
Give the joy of giving. Find out how at www.charity-checks.org.

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/




More information about the Python-list mailing list