Scrollbar

The #GtkScrollbar widget is a horizontal or vertical scrollbar, depending on the value of the #GtkOrientable:orientation property.

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

__anonymous
mixin OrientableT!(GtkRange)
Undocumented in source.
getType
GType getType()
getAdjustment
Adjustment getAdjustment()

Get the #GtkAdjustment which is the “model” object for #GtkRange. See gtk_range_set_adjustment() 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 gtk_range_set_flippable().

getInverted
bool getInverted()

Gets the value set by gtk_range_set_inverted().

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 #GtkRange 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 #GtkRange::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 #GtkRange 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 #GtkScale and nonzero for #GtkScrollbar, 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 #GtkScrollbar arrows or moves #GtkScale 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 #GtkRange, 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 gtk_range_set_fill_level() 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 #GtkRange::change-value.

setShowFillLevel
void setShowFillLevel(bool showFillLevel)

Sets whether a graphical fill level is show on the trough. See gtk_range_set_fill_level() 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 #GtkRange::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 #GtkRange::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.

Meta