Gtk.Scrollbar

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Buildable->Gtk.Widget Gtk.Range Gtk.Range Gtk.Orientable->Gtk.Range Gtk.Scrollbar Gtk.Scrollbar Gtk.Range->Gtk.Scrollbar Gtk.Widget->Gtk.Range

Example

../_images/Scrollbar.png
Subclasses:

Gtk.HScrollbar, Gtk.VScrollbar

Methods

Inherited:

Gtk.Range (28), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)

Structs:

Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new (orientation, adjustment)

Virtual Methods

Inherited:

Gtk.Range (6), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited:

Gtk.Range (8), Gtk.Widget (39), Gtk.Orientable (1)

Style Properties

Inherited:

Gtk.Range (8), Gtk.Widget (17)

Name

Type

Default

Flags

Short Description

fixed-slider-length

bool

False

r

Don’t change slider size, just lock it to the minimum length

has-backward-stepper

bool

True

r

xlib.Display the standard backward arrow button

has-forward-stepper

bool

True

r

xlib.Display the standard forward arrow button

has-secondary-backward-stepper

bool

False

r

xlib.Display a second backward arrow button on the opposite end of the scrollbar

has-secondary-forward-stepper

bool

False

r

xlib.Display a second forward arrow button on the opposite end of the scrollbar

min-slider-length

int

21

d/r

Minimum length of scrollbar slider deprecated

Signals

Inherited:

Gtk.Range (4), Gtk.Widget (69), GObject.Object (1)

Fields

Inherited:

Gtk.Range (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

range

Gtk.Range

r

Class Details

class Gtk.Scrollbar(**kwargs)
Bases:

Gtk.Range

Abstract:

No

Structure:

Gtk.ScrollbarClass

The Gtk.Scrollbar widget is a horizontal or vertical scrollbar, depending on the value of the Gtk.Orientable :orientation property.

Its position and movement are controlled by the adjustment that is passed to or created by Gtk.Scrollbar.new(). See Gtk.Adjustment for more details. The Gtk.Adjustment :value field sets the position of the thumb and must be between Gtk.Adjustment :lower and Gtk.Adjustment :upper - Gtk.Adjustment :page-size. The Gtk.Adjustment :page-size represents the size of the visible scrollable area. The fields Gtk.Adjustment :step-increment and Gtk.Adjustment :page-increment fields are added to or subtracted from the Gtk.Adjustment :value when the user asks to move by a step (using e.g. the cursor arrow keys or, if present, the stepper buttons) or by a page (using e.g. the Page Down/Up keys).

CSS nodes
scrollbar[.fine-tune]
╰── contents
    ├── [button.up]
    ├── [button.down]
    ├── trough
    │   ╰── slider
    ├── [button.up]
    ╰── [button.down]

Gtk.Scrollbar has a main CSS node with name scrollbar and a subnode for its contents, with subnodes named trough and slider.

The main node gets the style class .fine-tune added when the scrollbar is in ‘fine-tuning’ mode.

If steppers are enabled, they are represented by up to four additional subnodes with name button. These get the style classes .up and .down to indicate in which direction they are moving.

Other style classes that may be added to scrollbars inside Gtk.ScrolledWindow include the positional classes (.left, .right, .top, .bottom) and style classes related to overlay scrolling (.overlay-indicator, .dragging, .hovering).

classmethod new(orientation, adjustment)[source]
Parameters:
Returns:

the new Gtk.Scrollbar.

Return type:

Gtk.Widget

Creates a new scrollbar with the given orientation.

New in version 3.0.