Scrollbar

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

The position of the thumb in a scrollbar is controlled by the scroll adjustments. See #GtkAdjustment for the fields in an adjustment - for #GtkScrollbar, the #GtkAdjustment:value field represents the position of the scrollbar, which must be between the #GtkAdjustment:lower field and #GtkAdjustment:upper - #GtkAdjustment:page-size. The #GtkAdjustment:page-size field represents the size of the visible scrollable area. The #GtkAdjustment:step-increment and #GtkAdjustment:page-increment fields are properties when the user asks to step down (using the small stepper arrows) or page down (using for example the Page Down key).

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()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

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()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
__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.

OnAdjustBoundsDelegateWrapper
class OnAdjustBoundsDelegateWrapper
Undocumented in source.
onAdjustBoundsListeners
OnAdjustBoundsDelegateWrapper[] onAdjustBoundsListeners;
Undocumented in source.
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.

callBackAdjustBounds
void callBackAdjustBounds(GtkRange* rangeStruct, double value, OnAdjustBoundsDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackAdjustBoundsDestroy
void callBackAdjustBoundsDestroy(OnAdjustBoundsDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnAdjustBounds
void internalRemoveOnAdjustBounds(OnAdjustBoundsDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnChangeValueDelegateWrapper
class OnChangeValueDelegateWrapper
Undocumented in source.
onChangeValueListeners
OnChangeValueDelegateWrapper[] onChangeValueListeners;
Undocumented in source.
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.

callBackChangeValue
int callBackChangeValue(GtkRange* rangeStruct, GtkScrollType scroll, double value, OnChangeValueDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackChangeValueDestroy
void callBackChangeValueDestroy(OnChangeValueDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnChangeValue
void internalRemoveOnChangeValue(OnChangeValueDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnMoveSliderDelegateWrapper
class OnMoveSliderDelegateWrapper
Undocumented in source.
onMoveSliderListeners
OnMoveSliderDelegateWrapper[] onMoveSliderListeners;
Undocumented in source.
addOnMoveSlider
gulong addOnMoveSlider(void delegate(GtkScrollType, Range) dlg, ConnectFlags connectFlags)

Virtual function that moves the slider. Used for keybindings.

callBackMoveSlider
void callBackMoveSlider(GtkRange* rangeStruct, GtkScrollType step, OnMoveSliderDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackMoveSliderDestroy
void callBackMoveSliderDestroy(OnMoveSliderDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnMoveSlider
void internalRemoveOnMoveSlider(OnMoveSliderDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnValueChangedDelegateWrapper
class OnValueChangedDelegateWrapper
Undocumented in source.
onValueChangedListeners
OnValueChangedDelegateWrapper[] onValueChangedListeners;
Undocumented in source.
addOnValueChanged
gulong addOnValueChanged(void delegate(Range) dlg, ConnectFlags connectFlags)

Emitted when the range value changes.

callBackValueChanged
void callBackValueChanged(GtkRange* rangeStruct, OnValueChangedDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackValueChangedDestroy
void callBackValueChangedDestroy(OnValueChangedDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnValueChanged
void internalRemoveOnValueChanged(OnValueChangedDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta