and height options to specify an overall canvas sizegive the ( ,ycoordinates of the upper-left and lower-right corners of the canvas in four-item tuple passed to the scrollregion option if no view area size is givena default size is used if no scrollregion is givenit defaults to the view area sizethis makes the scroll bar uselesssince the view is assumed to hold the entire canvas mapping coordinates is bit subtler if the scrollable view area associated with canvas is smaller than the canvas at largethe ( ,ycoordinates returned in event objects are view area coordinatesnot overall canvas coordinates you'll generally want to scale the event coordinates to canvas coordinatesby passing them to the canvasx and canvasy canvas methods before using them to process objects for exampleif you run the scrolled canvas script and watch the messages printed on mouse double-clicksyou'll notice that the event coordinates are always relative to the displayed view windownot to the overall canvasc:\pp \gui\tourpython scrolledcanvas py event , when scrolled to top of canvas canvas , -sameas long as no border pixels event , when scrolled to bottom of canvas canvas , - differs radically when scrolled to midpoint in the canvas herethe mapped canvas is always the same as the canvas because the display area and canvas are both set at pixels wide (it would be off by pixels due to automatic borders if not for the script' highlightthickness settingbut notice that the mapped is wildly different from the event if you click after vertical scroll without scalingthe event' incorrectly points to spot much higher in the canvas many of this book' canvas examples need no such scaling--( , always maps to the upper-left corner of the canvas display in which mouse click occurs--but just because canvases are not scrolled see the next section for canvas with both horizontal and vertical scrollsthe pytree program later in this book is similarbut it also uses dynamically changed scrollable region sizes when new trees are viewed as rule of thumbif your canvases scrollbe sure to scale event coordinates to true canvas coordinates in callback handlers that care about positions some handlers might not care whether events are bound to individual drawn objects or embedded widgets instead of the canvas at largebut we need to move on to the next two sections to see how tkinter tourpart