PyGTK Scrollbar Class - PyGTK

What is PyGTK Scrollbar Class?

The present class is an abstract base class for gtk.Hscrollbar and gtk.Vscrollbar widgets. Both are linked with an Adjustment object. The position of the thumb of the scrollbar is controlled by scroll adjustments. The attributes of adjustment object are used as follows −


The minimum value of the scroll region


The maximum value of the scroll region


Represents the position of the scrollbar, which must be between lower and upper


Represents the size of the visible scrollable area


Distance to scroll when the small stepper arrows are clicked


Distance to scroll when thePage UporPage Downkeys pressed

The resulting program shows an HScale and an HScrollbar widget placed in a VBox added to the toplevel window. Each of them is associated with an adjustment object.

A gtk.HScale widget is a slider control attached with adj1. Its update policy, number and position of drawing value are set up as follows –

gtk.HScrollbar provides a horizontal scrollbar. It is associated with adj2 object. Its update policy too is set to CONTINUOUS.

In order to show rapid value of the scrollbar, 'value-changed' signal of the adjustment object — adj2 is connected to callback function on_scrolled(). The function retrieves the value property of adjustment object and displays it on a label below the scrollbar.


Observe the resulting code –

The above code will make the resulting output –


All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

PyGTK Topics