scroll ( textlistsso that the scroll bars remain as the window shrinks attaching widgets to frames in larger termsthe critical innovation in this example is its use of framesframe widgets are just containers for other widgetsand so give rise to the notion of guis as widget hierarchiesor trees herewin serves as an enclosing window for the other three widgets in generalthoughby attaching widgets to framesand frames to other frameswe can build up arbitrary gui layouts simply divide the user interface into set of increasingly smaller rectanglesimplement each as tkinter frameand attach basic widgets to the frame in the desired screen position in this scriptwhen you specify win in the first argument to the label and button constructorstkinter attaches them to the frame (they become children of the win parentwin itself is attached to the default top-level windowsince we didn' pass parent to the frame constructor when we ask win to run itself (by calling mainloop)tkinter draws all the widgets in the tree we've built the three child widgets also provide pack options nowthe side arguments tell which part of the containing frame ( winto attach the new widget to the label hooks onto the topand the buttons attach to the sides topleftand right are all preassigned string variables imported from tkinter arranging widgets is bit subtler than simply giving sidethoughbut we need to take quick detour into packer geometry management details to see why layoutpacking order and side attachments when widget tree is displayedchild widgets appear inside their parents and are arranged according to their order of packing and their packing options because of thisthe order in which widgets are packed not only gives their clipping orderbut also determines how their side settings play out in the generated display here' how the packer' layout system works the packer starts out with an available space cavity that includes the entire parent container ( the whole frame or top-level window as each widget is packed on sidethat widget is given the entire requested side in the remaining space cavityand the space cavity is shrunk later pack requests are given an entire side of what is leftafter earlier pack requests have shrunk the cavity after widgets are given cavity spaceexpand divides any space leftand fill and anchor stretch and position widgets within their assigned space adding multiple widgets