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 −

lower

The minimum value of the scroll region

upper

The maximum value of the scroll region

value

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

page_size

Represents the size of the visible scrollable area

step_increment

Distance to scroll when the small stepper arrows are clicked

page_increment

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.

Example

Observe the resulting code –

The above code will make the resulting output –

range_widgets_demo

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

PyGTK Topics