pack() and the division of vertical space
I am trying to figure out how to stack two widgets in a frame
vertically so that they both expand horizontally and during vertical
expansion, the top one sticks to the top of the frame and the bottom
one consumes the remaining vertical space. I thought this would do it
but it doesn't. What am I missing?
from Tkinter import *
class AFrame(Frame):
def __init__(self,master,**config):
Frame.__init__(self,master,config)
size=50
self.l1= Label(text="abc",relief="groove")
self.l1.pack(side=TOP,expand=YES,fill=X,anchor=N)
self.l2= Label(text="abc",relief="groove")
self.l2.pack(side=TOP,expand=YES,fill=BOTH)
af= AFrame(None)
af.pack(side=TOP,expand=YES,fill=BOTH)
mainloop()
.
Relevant Pages
- Re: tk widget
... But the fields have to be cleared also, meaning they can show in the window but internally they need to be cleared, because when the user types a part no for the first field the rest of the fields are dependent on this part no and the window will adjust based on the number fo fields. ... Your "Clear_ALL" procedure probably needs to delete the widgets. ... You can create an empty frame that serves as a placeholder. ... It's as if each form is a piece of paper in a stack, and you take out the appropriate page and place it on the top of the stack. ... (comp.lang.tcl) - Re: [OT] [Question]activities of stack pointer and frame pointer when function called
... >>I suspect you don't understand what as stack frame is. ... A function stack frame is a method to keep track of function ... At the point of creation the caller is ... When the callee returns to its ... (comp.lang.c) - Re: [PATCH 2/2] function-graph: add stack frame test
... In case gcc does something funny with the stack frames, ... frame of the parent function, and will test that frame on exit. ... This modifies the parameters of one of the functions that the arch ... movl 0xc, %edx ... (Linux-Kernel) - Re: What is a stack frame?
... There is no need for a separate "this frame" pointer. ... In any case, the more general term, which covers what a C compiler ... hardware-provided stack to implement the stack-like data structure ... manner since the current stack frame is "deformed" by alloca. ... (comp.lang.c) - Re: LPC900/80C51 Compiler Toolchain
... Although the fixed-size frame optimization is orthogonal to removing ... storing stack arguments is less important in such cases. ... storing data at (SP + offset) takes exactly the same time ... up and uses up another 2 registers. ... (comp.arch.embedded) |
|