button(wintext='hello'command=greetingpack(side=leftlabel(wintext='hello container world'pack(side=topbutton(wintext='quit'command=win quitpack(side=rightyou will wind up with the very different display shown in figure - even though you've moved the label code only one line down in the source file (contrast with figure - figure - packing the label second despite its side settingthe label does not get the entire top of the window nowand you have to think in terms of shrinking cavities to understand why because the hello button is packed firstit is given the entire left side of the frame nextthe label is given the entire top side of what is left finallythe quit button gets the right side of the remainder-- rectangle to the right of the hello button and under the label when this window shrinkswidgets are clipped in reverse order of their packingthe quit button disappears firstfollowed by the label in the original version of this example (figure - )the label spans the entire top side just because it is the first one packednot because of its side option in factif you look at figure - closelyyou'll see that it illustrates the same point--the label appeared between the buttonsbecause they had already carved off the entire left and right sides the packer' expand and fill revisited beyond the effects of packing orderthe fill option we met earlier can be used to stretch the widget to occupy all the space in the cavity side it has been givenand any cavity space left after all packing is evenly allocated among widgets with the expand=yes we saw before for examplecoding this way creates the window in figure - (compare this to figure - )button(wintext='hello'command=greetingpack(side=left,fill=ylabel(wintext='hello container world'pack(side=topbutton(wintext='quit'command=win quitpack(side=rightexpand=yesfill=xtechnicallythe packing steps are just rerun again after window resize but since this means that there won' be enough space left for widgets packed last when the window shrinksit is as if widgets packed first are clipped last graphical user interfaces