Python Tkinter Scrollbar
The scrollbar widget is used to scroll down the content of the other widgets like listbox, text, and canvas. However, we can also create the horizontal scrollbars to the Entry widget.
The syntax to use the Scrollbar widget is given below.
A list of possible options is given below.
||The background color of the widget when it has the focus.
||The background color of the widget.
||The border width of the widget.
||It can be set to the procedure associated with the list which can be called each time when the scrollbar is moved.
||The mouse pointer is changed to the cursor type set to this option which can be an arrow, dot, etc.
||It represents the border width around the arrow heads and slider. The default value is -1.
||The focus highlighcolor when the widget doesn't have the focus.
||The focus highlighcolor when the widget has the focus.
||It represents the thickness of the focus highlight.
||It is used to control the behavior of the scroll jump. If it set to 1, then the callback is called when the user releases the mouse button.
||It can be set to HORIZONTAL or VERTICAL depending upon the orientation of the scrollbar.
||This option tells the duration up to which the button is to be pressed before the slider starts moving in that direction repeatedly. The default is 300 ms.
||The default value of the repeat interval is 100.
||We can tab the focus through this widget by default. We can set this option to 0 if we don't want this behavior.
||It represents the color of the trough.
||It represents the width of the scrollbar.
The widget provides the following methods.
||It returns the two numbers a and b which represents the current position of the scrollbar.
||It is used to connect the scrollbar to the other widget w. The yscrollcommand or xscrollcommand of the other widget to this method.