Gnome::Gtk4::Scrollbar
#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------
Description
The Gnome::Gtk4::Scrollbar widget is a horizontal or vertical scrollbar.
=for image :src<asset_files/images/scrollbar.png> :width<30%> :class<inline>
Its position and movement are controlled by the adjustment that is passed to or created by .newscrollbar(). See Gnome::Gtk4::Adjustment for more details. The value defined in Gnome::Gtk4::Adjustment field sets the position of the thumb and must be between lower defined in Gnome::Gtk4::Adjustment and upper defined in Gnome::Gtk4::Adjustment - page-size defined in Gnome::Gtk4::Adjustment. The page-size defined in Gnome::Gtk4::Adjustment represents the size of the visible scrollable area.
The fields step-increment defined in Gnome::Gtk4::Adjustment and page-increment defined in Gnome::Gtk4::Adjustment fields are added to or subtracted from the value defined in Gnome::Gtk4::Adjustment when the user asks to move by a step (using e.g. the cursor arrow keys) or by a page (using e.g. the Page Down/Up keys).
CSS nodes
Gnome::Gtk4::Scrollbar has a main CSS node with name scrollbar and a subnode for its contents. The main node gets the .horizontal or .vertical style classes applied, depending on the scrollbar's orientation.
The range node gets the style class .fine-tune added when the scrollbar is in 'fine-tuning' mode.
Other style classes that may be added to scrollbars inside Gnome::Gtk4::ScrolledWindow include the positional classes (.left, .right, .top, .bottom) and style classes related to overlay scrolling (.overlay-indicator, .dragging, .hovering).
Accessibility
Gnome::Gtk4::Scrollbar uses the GTK_ACCESSIBLE_ROLE_SCROLLBAR role.
Uml Diagram =for image :src<asset_files/images/plantuml/Scrollbar.png> :width<70%> :class<inline>
#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------
Class initialization
new
:native-object
Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object() :$native-object! )
#-------------------------------------------------------------------------------
new-scrollbar
Creates a new scrollbar with the given orientation.
method new-scrollbar ( GtkOrientation $orientation, N-Object() $adjustment --> Gnome::Gtk4::Scrollbar )
$orientation; the scrollbar’s orientation..
$adjustment; the Gnome::Gtk4::Adjustment to use, or undefined to create a new adjustment..
#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------
Methods
#-------------------------------------------------------------------------------
get-adjustment
Returns the scrollbar's adjustment.
method get-adjustment (--> N-Object )
Return value; the scrollbar's adjustment.
#-------------------------------------------------------------------------------
set-adjustment
Makes the scrollbar use the given adjustment.
method set-adjustment ( N-Object() $adjustment )
$adjustment; the adjustment to set.