cuts out part of the list but retains the scroll bar figure - scrolledlist gets small at the same timeyou don' generally want scroll bar to expand with windowso be sure to pack it with just fill= (or fill= for horizontal scrolland not an expand=yes expanding this example' window in figure - for instancemade the listbox grow along with the windowbut it kept the scroll bar attached to the right and kept it the same size we'll see both scroll bars and listboxes repeatedly in later examples in this and later (flip ahead to examples for pyeditpymailguipyformpytreeand shellgui for moreand although the example script in this section captures the fundamentalsi should point out that there is more to both scroll bars and listboxes than meets the eye here for exampleit' just as easy to add horizontal scroll bars to scrollable widgets they are programmed almost exactly like the vertical one implemented herebut callback handler names start with " ,not " ( xscrollcommand)and an orient='horizontalconfiguration option is set for the scroll bar object to add both vertical and horizontal scrolls and to crosslink their motionsyou would use the following sort of codewindow frame(selfvscroll scrollbar(windowhscroll scrollbar(windoworient='horizontal'listbox listbox(windowmove listbox when scroll moved vscroll config(command=listbox yviewrelief=sunkenhscroll config(command=listbox xviewrelief=sunkenmove scroll when listbox moved listbox config(yscrollcommand=vscroll setrelief=sunkenlistbox config(xscrollcommand=hscroll setsee the image viewer canvas later in this as well as the pyeditpytreeand pymailgui programs later in this bookfor examples of horizontal scroll bars at work scroll bars see more kinds of gui action too--they can be associated with other kinds of widgets in the tkinter library for instanceit is common to attach one to the text listboxes and scrollbars