Scrollbar

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

Its position and movement are controlled by the adjustment that is passed to or created by Scrollbar.new. See gtk.Adjustment for more details. The value field sets the position of the thumb and must be between lower and upper - page-size. The page-size represents the size of the visible scrollable area. The fields step-increment and page-increment fields are added to or subtracted from the 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

|[<!-- language="plain" --> scrollbar[.fine-tune] ╰── contents ├── button.up ├── button.down ├── trough │ ╰── slider ├── button.up ╰── button.down

GtkScrollbar 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.ScrolledWindow|gtk.ScrolledWindow]
include the positional classes (.left, .right, .top, .bottom) and style
classes related to overlay scrolling (.overlay-indicator, .dragging, .hovering).

Constructors

this
this(GtkScrollbar* gtkScrollbar, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(GtkOrientation orientation, Adjustment adjustment)

Creates a new scrollbar with the given orientation.

Members

Functions

getScrollbarStruct
GtkScrollbar* getScrollbarStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

Static functions

getType
GType getType()

Variables

gtkScrollbar
GtkScrollbar* gtkScrollbar;

the main Gtk struct

Inherited Members

From Range

gtkRange
GtkRange* gtkRange;

the main Gtk struct

getRangeStruct
GtkRange* getRangeStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getAdjustment
Adjustment getAdjustment()

Get the gtk.Adjustment which is the “model” object for gtk.Range See Range.setAdjustment for details. The return value does not have a reference added, so should not be unreferenced.

getFillLevel
double getFillLevel()

Gets the current position of the fill level indicator.

getFlippable
bool getFlippable()

Gets the value set by Range.setFlippable.

getInverted
bool getInverted()

Gets the value set by Range.setInverted.

getLowerStepperSensitivity
GtkSensitivityType getLowerStepperSensitivity()

Gets the sensitivity policy for the stepper that points to the 'lower' end of the GtkRange’s adjustment.

getMinSliderSize
int getMinSliderSize()

This function is useful mainly for gtk.Range subclasses.

getRangeRect
void getRangeRect(GdkRectangle rangeRect)

This function returns the area that contains the range’s trough and its steppers, in widget->window coordinates.

getRestrictToFillLevel
bool getRestrictToFillLevel()

Gets whether the range is restricted to the fill level.

getRoundDigits
int getRoundDigits()

Gets the number of digits to round the value to when it changes. See change-value.

getShowFillLevel
bool getShowFillLevel()

Gets whether the range displays the fill level graphically.

getSliderRange
void getSliderRange(int sliderStart, int sliderEnd)

This function returns sliders range along the long dimension, in widget->window coordinates.

getSliderSizeFixed
bool getSliderSizeFixed()

This function is useful mainly for gtk.Range subclasses.

getUpperStepperSensitivity
GtkSensitivityType getUpperStepperSensitivity()

Gets the sensitivity policy for the stepper that points to the 'upper' end of the GtkRange’s adjustment.

getValue
double getValue()

Gets the current value of the range.

setAdjustment
void setAdjustment(Adjustment adjustment)

Sets the adjustment to be used as the “model” object for this range widget. The adjustment indicates the current range value, the minimum and maximum range values, the step/page increments used for keybindings and scrolling, and the page size. The page size is normally 0 for gtk.Scale and nonzero for gtk.Scrollbar, and indicates the size of the visible area of the widget being scrolled. The page size affects the size of the scrollbar slider.

setFillLevel
void setFillLevel(double fillLevel)

Set the new position of the fill level indicator.

setFlippable
void setFlippable(bool flippable)

If a range is flippable, it will switch its direction if it is horizontal and its direction is GTK_TEXT_DIR_RTL.

setIncrements
void setIncrements(double step, double page)

Sets the step and page sizes for the range. The step size is used when the user clicks the gtk.Scrollbar arrows or moves gtk.Scale via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.

setInverted
void setInverted(bool setting)

Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right. Inverted ranges have higher values at the top or on the right rather than on the bottom or left.

setLowerStepperSensitivity
void setLowerStepperSensitivity(GtkSensitivityType sensitivity)

Sets the sensitivity policy for the stepper that points to the 'lower' end of the GtkRange’s adjustment.

setMinSliderSize
void setMinSliderSize(int minSize)

Sets the minimum size of the range’s slider.

setRange
void setRange(double min, double max)

Sets the allowable values in the gtk.Range, and clamps the range value to be between min and max. (If the range has a non-zero page size, it is clamped between min and max - page-size.)

setRestrictToFillLevel
void setRestrictToFillLevel(bool restrictToFillLevel)

Sets whether the slider is restricted to the fill level. See Range.setFillLevel for a general description of the fill level concept.

setRoundDigits
void setRoundDigits(int roundDigits)

Sets the number of digits to round the value to when it changes. See change-value.

setShowFillLevel
void setShowFillLevel(bool showFillLevel)

Sets whether a graphical fill level is show on the trough. See Range.setFillLevel for a general description of the fill level concept.

setSliderSizeFixed
void setSliderSizeFixed(bool sizeFixed)

Sets whether the range’s slider has a fixed size, or a size that depends on its adjustment’s page size.

setUpperStepperSensitivity
void setUpperStepperSensitivity(GtkSensitivityType sensitivity)

Sets the sensitivity policy for the stepper that points to the 'upper' end of the GtkRange’s adjustment.

setValue
void setValue(double value)

Sets the current value of the range; if the value is outside the minimum or maximum range values, it will be clamped to fit inside them. The range emits the value-changed signal if the value changes.

addOnAdjustBounds
gulong addOnAdjustBounds(void delegate(double, Range) dlg, ConnectFlags connectFlags)

Emitted before clamping a value, to give the application a chance to adjust the bounds.

addOnChangeValue
gulong addOnChangeValue(bool delegate(GtkScrollType, double, Range) dlg, ConnectFlags connectFlags)

The change-value signal is emitted when a scroll action is performed on a range. It allows an application to determine the type of scroll event that occurred and the resultant new value. The application can handle the event itself and return TRUE to prevent further processing. Or, by returning FALSE, it can pass the event to other handlers until the default GTK+ handler is reached.

addOnMoveSlider
gulong addOnMoveSlider(void delegate(GtkScrollType, Range) dlg, ConnectFlags connectFlags)

Virtual function that moves the slider. Used for keybindings.

addOnValueChanged
gulong addOnValueChanged(void delegate(Range) dlg, ConnectFlags connectFlags)

Emitted when the range value changes.