Shows a horizontal or vertical scrollbar.
<picture> <source srcset="scrollbar-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An example GtkScrollbar" src="scrollbar.png"> </picture> Its position and movement are controlled by the adjustment that is passed to or created by [ctorGtk.Scrollbar.new]. See [classGtk.Adjustment] for more details. The [propertyGtk.Adjustment:value] field sets the position of the thumb and must be between [propertyGtk.Adjustment:lower] and [propertyGtk.Adjustment:upper] - [propertyGtk.Adjustment:page-size]. The [propertyGtk.Adjustment:page-size] represents the size of the visible scrollable area.
The fields [propertyGtk.Adjustment:step-increment] and [propertyGtk.Adjustment:page-increment] fields are added to or subtracted from the [propertyGtk.Adjustment:value] 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
scrollbar â°ââ range[.fine-tune] â°ââ trough â°ââ slider
GtkScrollbar 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 [classGtk.ScrolledWindow] include the positional classes (.left, .right, .top, .bottom) and style classes related to overlay scrolling (.overlay-indicator, .dragging, .hovering).
# Accessibility
GtkScrollbar uses the [enumGtk.AccessibleRole.scrollbar] role.
function "+"
(Widget : access Gtk_Scrollbar_Record'Class)
return Gtk.Accessible.Gtk_Accessible
function "+"
(Widget : access Gtk_Scrollbar_Record'Class)
return Gtk.Accessible_Range.Gtk_Accessible_Range
function "+"
(Widget : access Gtk_Scrollbar_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Scrollbar_Record'Class)
return Gtk.Constraint_Target.Gtk_Constraint_Target
function "+"
(Widget : access Gtk_Scrollbar_Record'Class)
return Gtk.Orientable.Gtk_Orientable
function "-"
(Interf : Gtk.Accessible.Gtk_Accessible)
return Gtk_Scrollbar
function "-"
(Interf : Gtk.Accessible_Range.Gtk_Accessible_Range)
return Gtk_Scrollbar
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Scrollbar
function "-"
(Interf : Gtk.Constraint_Target.Gtk_Constraint_Target)
return Gtk_Scrollbar
function "-"
(Interf : Gtk.Orientable.Gtk_Orientable)
return Gtk_Scrollbar
Adjustment_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Adjustment.Gtk_Adjustment The GtkAdjustment controlled by this scrollbar.
procedure Announce
(Self : not null access Gtk_Scrollbar_Record;
Message : UTF8_String;
Priority : Gtk.Accessible.Gtk_Accessible_Announcement_Priority)
function Get_Accessible_Id
(Self : not null access Gtk_Scrollbar_Record) return UTF8_String
function Get_Accessible_Parent
(Self : not null access Gtk_Scrollbar_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Accessible_Role
(Self : not null access Gtk_Scrollbar_Record)
return Gtk.Accessible.Gtk_Accessible_Role
function Get_Adjustment
(Self : not null access Gtk_Scrollbar_Record)
return Gtk.Adjustment.Gtk_Adjustment
Returns the scrollbar's adjustment.
the scrollbar's adjustment. Has transfer-ownership='none'.
function Get_At_Context
(Self : not null access Gtk_Scrollbar_Record)
return Gtk.Atcontext.Gtk_Atcontext
function Get_Bounds
(Self : not null access Gtk_Scrollbar_Record;
X : out Glib.Gint;
Y : out Glib.Gint;
Width : out Glib.Gint;
Height : out Glib.Gint) return Boolean
function Get_First_Accessible_Child
(Self : not null access Gtk_Scrollbar_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Next_Accessible_Sibling
(Self : not null access Gtk_Scrollbar_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Orientation
(Self : not null access Gtk_Scrollbar_Record)
return Gtk.Enums.Gtk_Orientation
function Get_Platform_State
(Self : not null access Gtk_Scrollbar_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State) return Boolean
function Get_Type return Glib.GType
procedure Gtk_New
(Self : out Gtk_Scrollbar;
Orientation : Gtk.Enums.Gtk_Orientation;
Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class)
Creates a new scrollbar with the given orientation. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
the scrollbar's orientation.
the [classGtk.Adjustment] to use, or null to create a new adjustment.
type Gtk_Scrollbar is access all Gtk_Scrollbar_Record'Class;
function Gtk_Scrollbar_New
(Orientation : Gtk.Enums.Gtk_Orientation;
Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class)
return Gtk_Scrollbar
Creates a new scrollbar with the given orientation.
the scrollbar's orientation.
the [classGtk.Adjustment] to use, or null to create a new adjustment.
type Gtk_Scrollbar_Record is new Gtk_Widget_Record with null record;
package Implements_Gtk_Accessible is new Glib.Types.Implements
(Gtk.Accessible.Gtk_Accessible, Gtk_Scrollbar_Record, Gtk_Scrollbar);
package Implements_Gtk_Accessible_Range is new Glib.Types.Implements
(Gtk.Accessible_Range.Gtk_Accessible_Range, Gtk_Scrollbar_Record, Gtk_Scrollbar);
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Scrollbar_Record, Gtk_Scrollbar);
package Implements_Gtk_Constraint_Target is new Glib.Types.Implements
(Gtk.Constraint_Target.Gtk_Constraint_Target, Gtk_Scrollbar_Record, Gtk_Scrollbar);
package Implements_Gtk_Orientable is new Glib.Types.Implements
(Gtk.Orientable.Gtk_Orientable, Gtk_Scrollbar_Record, Gtk_Scrollbar);
procedure Initialize
(Self : not null access Gtk_Scrollbar_Record'Class;
Orientation : Gtk.Enums.Gtk_Orientation;
Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class)
Creates a new scrollbar with the given orientation. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
the scrollbar's orientation.
the [classGtk.Adjustment] to use, or null to create a new adjustment.
procedure Reset_Property
(Self : not null access Gtk_Scrollbar_Record;
Property : Gtk.Accessible.Gtk_Accessible_Property)
procedure Reset_Relation
(Self : not null access Gtk_Scrollbar_Record;
Relation : Gtk.Accessible.Gtk_Accessible_Relation)
procedure Reset_State
(Self : not null access Gtk_Scrollbar_Record;
State : Gtk.Accessible.Gtk_Accessible_State)
procedure Set_Accessible_Parent
(Self : not null access Gtk_Scrollbar_Record;
Parent : Gtk.Accessible.Gtk_Accessible;
Next_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Set_Adjustment
(Self : not null access Gtk_Scrollbar_Record;
Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class)
Makes the scrollbar use the given adjustment.
the adjustment to set
procedure Set_Orientation
(Self : not null access Gtk_Scrollbar_Record;
Orientation : Gtk.Enums.Gtk_Orientation)
procedure Update_Next_Accessible_Sibling
(Self : not null access Gtk_Scrollbar_Record;
New_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Update_Platform_State
(Self : not null access Gtk_Scrollbar_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State)