How to Resize Canvas Scrollbars With Tkinter

Tkinter is a Python programming tool that is included in the standard version of Python. The Canvas plugin, though, is not. This free addon allows you to display Python pages individually, giving you greater flexibility to maneuver them. You can add a scrollbar to a particular canvas, and resize the scrollbars to look however you like. As always in the Canvas plugin, you control the size by positioning it on the geometric Canvas grid.

Instructions

    • 1

      Open your Python code.

    • 2

      Find the section that begins “canvas.config.”

    • 3

      Add the following line within the canvas.config code (before the closing bracket):
      scrollregion=canvas.bbox(W,X,Y,Z)

    • 4

      Change the “W,X,Y,Z” coordinates to the desired coordinates of the scrollbar. As always, start in the upper left corner and go clockwise. Click “Preview” at any point to preview the Canvas on the grid. You can then adjust the coordinates accordingly.

Related Searches

References

Related Ads

Featured
View Mobile Site