sbar config(command=list yviewlist config(yscrollcommand=sbar setsbar pack(side=rightfill=ylist pack(side=leftexpand=yesfill=bothpos for label in optionslist insert(poslabelpos + #list config(selectmode=singlesetgrid= list bind(''self handlelistself listbox list def runcommand(selfselection)print('you selected:'selectionif __name__ ='__main__'options (('lumberjack-%sxfor scrolledlist(optionsmainloop(xlink sbar and list move one moves other pack first=clip last list clipped first add to listbox or insert(end,labelor enumerate(optionsselect,resize modes set event handler redefine me lower in range( )or map/lambdathis module can be run standalone to experiment with these widgetsbut it is also designed to be useful as library object by passing in different selection lists to the options argument and redefining the runcommand method in subclassthe scrolled list component class defined here can be reused anytime you need to display scrollable list in factwe'll be reusing it this way in ' pyedit program with just little forethoughtit' easy to extend the tkinter library with python classes this way when run standalonethis script generates the window in figure - shown here with windows look-and-feel it' framewith listbox on its left containing generated entries (the fifth has been clicked)along with an associated scrollbar on its right for moving through the list if you move the scrollthe list movesand vice versa figure - scrolledlist at the top listboxes and scrollbars