def fillcontent(selfcanv)override me below for in range( )canv create_text( +( * )text='spam'+str( )fill='beige'def ondoubleclick(selfevent)override me below print(event xevent yprint(self canvas canvasx(event )self canvas canvasy(event )if __name__ ='__main__'scrolledcanvas(mainloop(this script makes the window in figure - it is similar to prior scroll examplesbut scrolled canvases introduce two new kinks in the scrolling modelscrollable versus viewable sizes you can specify the size of the displayed view windowbut you must specify the size of the scrollable canvas at large the size of the view window is what is displayedand it can be changed by the user by resizing the size of the scrollable canvas will generally be larger--it includes the entire contentof which only part is displayed in the view window scrolling moves the view window over the scrollable size canvas viewable to absolute coordinate mapping in additionyou may need to map between event view area coordinates and overall canvas coordinates if the canvas is larger than its view area in scrolling scenariothe canvas will almost always be larger than the part displayedso mapping is often needed when canvases are scrolled in some applicationsthis mapping is not requiredbecause widgets embedded in the canvas respond to users directly ( buttons in the pyphoto example in if the user interacts with the canvas directlythough ( in drawing program)mapping from view coordinates to scrollable size coordinates may be necessary figure - scrolledcanvas live canvas