[Tutor] Tkinter layout problem continued
DORSEY_EDMUND_K@LILLY.COM
DORSEY_EDMUND_K@LILLY.COM
Mon Jul 14 11:23:01 2003
This is a multipart message in MIME format.
--=_alternative 00544AC405256D63_=
Content-Type: text/plain; charset="us-ascii"
I'm still stuck with the grid manager but this time I coded it up real
simple and as a running program below.
#
from Tkinter import *
import Pmw
parent = Tk()
parent.geometry("400x200+300+300")
button_frame = Pmw.Group(parent, tag_text='Actions')
startButt = Button(button_frame.interior(), padx=20,text="Start",
bg='Green', command=parent.destroy)
exitButt = Button(button_frame.interior(), padx=20,text="Exit", bg='red',
command=parent.destroy)
pauseButt = Button(button_frame.interior(), padx=20,text="Pause",
bg='orange', command=parent.destroy)
startButt.grid(row=0,column=0, sticky=W)
exitButt.grid(row=0, column=1, sticky=W)
pauseButt.grid(row=0, column=2, sticky=W)
button_frame.grid(row=2, column=0, sticky=W+E) #Why doesn't the frame fill
the window?
parent.mainloop()
#
I can't seem to get the button_frame to fill the window eventhough it
should be expanding from left to right. The sticky calls don't seem to
have any affect. Does anyone know why this might be? Thank you for any
advice. ~Ed
--=_alternative 00544AC405256D63_=
Content-Type: text/html; charset="us-ascii"
<br><font size=2 face="sans-serif">I'm still stuck with the grid manager but this time I coded it up real simple and as a running program below.</font>
<br>
<br><font size=2 face="sans-serif">#</font>
<br><font size=2 face="sans-serif">from Tkinter import *</font>
<br><font size=2 face="sans-serif">import Pmw</font>
<br><font size=2 face="sans-serif">parent = Tk()</font>
<br><font size=2 face="sans-serif">parent.geometry("400x200+300+300")</font>
<br>
<br><font size=2 face="sans-serif">button_frame = Pmw.Group(parent, tag_text='Actions') </font>
<br><font size=2 face="sans-serif">startButt = Button(button_frame.interior(), padx=20,text="Start", bg='Green', command=parent.destroy)</font>
<br><font size=2 face="sans-serif">exitButt = Button(button_frame.interior(), padx=20,text="Exit", bg='red', command=parent.destroy)</font>
<br><font size=2 face="sans-serif">pauseButt = Button(button_frame.interior(), padx=20,text="Pause", bg='orange', command=parent.destroy)</font>
<br>
<br><font size=2 face="sans-serif">startButt.grid(row=0,column=0, sticky=W)</font>
<br><font size=2 face="sans-serif">exitButt.grid(row=0, column=1, sticky=W)</font>
<br><font size=2 face="sans-serif">pauseButt.grid(row=0, column=2, sticky=W) </font>
<br><font size=2 face="sans-serif">button_frame.grid(row=2, column=0, sticky=W+E) #Why doesn't the frame fill the window?</font>
<br><font size=2 face="sans-serif"> </font>
<br><font size=2 face="sans-serif">parent.mainloop()</font>
<br><font size=2 face="sans-serif">#</font>
<br>
<br><font size=2 face="sans-serif">I can't seem to get the button_frame to fill the window eventhough it should be expanding from left to right. The sticky calls don't seem to have any affect. Does anyone know why this might be? Thank you for any advice. ~Ed </font>
--=_alternative 00544AC405256D63_=--