An interface for widgets with native scrolling ability.
To implement this interface you should override the [propertyGtk.Scrollable:hadjustment] and [propertyGtk.Scrollable:vadjustment] properties.
## Creating a scrollable widget
All scrollable widgets should do the following.
When a parent widget sets the scrollable child widget's adjustments, the
widget should connect to the [signalGtk.Adjustment::value-changed] signal. The child widget should then populate the adjustments' properties as soon as possible, which usually means queueing an allocation right away and populating the properties in the [vfuncGtk.Widget.size_allocate] implementation.
Because its preferred size is the size for a fully expanded widget, the
scrollable widget must be able to cope with underallocations. This means that it must accept any value passed to its [vfuncGtk.Widget.size_allocate] implementation.
When the parent allocates space to the scrollable child widget, the
widget must ensure the adjustments' property values are correct and up to date, for example using [methodGtk.Adjustment.configure].
When any of the adjustments emits the
[signalGtk.Adjustment::value-changed] signal, the scrollable widget should scroll its contents.
function "+" (W : Gtk_Scrollable) return Gtk_Scrollable
function From_Object_Free
(B : not null access Gtk_Border) return Gtk_Border
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
function Get_Border
(Self : Gtk_Scrollable;
Border : out Gtk_Border) return Boolean
Returns the size of a non-scrolling border around the outside of the scrollable. An example for this would be treeview headers. GTK can use this information to display overlaid graphics, like the overshoot indication, at the right position.
return location for the results
True if Border has been set
function Get_Hadjustment
(Self : Gtk_Scrollable) return Gtk.Adjustment.Gtk_Adjustment
Retrieves the GtkAdjustment used for horizontal scrolling.
horizontal GtkAdjustment. Has transfer-ownership='none'.
function Get_Hscroll_Policy
(Self : Gtk_Scrollable) return Gtk.Enums.Gtk_Scrollable_Policy
Gets the horizontal GtkScrollablePolicy.
The horizontal GtkScrollablePolicy.
function Get_Type return Glib.GType
function Get_Vadjustment
(Self : Gtk_Scrollable) return Gtk.Adjustment.Gtk_Adjustment
Retrieves the GtkAdjustment used for vertical scrolling.
vertical GtkAdjustment. Has transfer-ownership='none'.
function Get_Vscroll_Policy
(Self : Gtk_Scrollable) return Gtk.Enums.Gtk_Scrollable_Policy
Gets the vertical GtkScrollablePolicy.
The vertical GtkScrollablePolicy.
type Gtk_Border is record
Left : Gint16;
Right : Gint16;
Top : Gint16;
Bottom : Gint16;
end record;
Specifies a border around a rectangular area.
Each side can have a different width.
type Gtk_Scrollable is new Glib.Types.GType_Interface;
Hadjustment_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Adjustment.Gtk_Adjustment Horizontal GtkAdjustment of the scrollable widget.
This adjustment is shared between the scrollable widget and its parent.
Hscroll_Policy_Property : constant Gtk.Enums.Property_Gtk_Scrollable_Policy;
Determines when horizontal scrolling should start.
Null_Gtk_Scrollable : constant Gtk_Scrollable;
subtype Scrollable_Interface_Descr is Glib.Object.Interface_Description;
procedure Set_Get_Border
(Self : Scrollable_Interface_Descr;
Handler : Virtual_Get_Border)
See Glib.Object.Add_Interface
procedure Set_Hadjustment
(Self : Gtk_Scrollable;
Hadjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class)
Sets the horizontal adjustment of the GtkScrollable.
a GtkAdjustment
procedure Set_Hscroll_Policy
(Self : Gtk_Scrollable;
Policy : Gtk.Enums.Gtk_Scrollable_Policy)
Sets the GtkScrollablePolicy. The policy determines whether horizontal scrolling should start below the minimum width or below the natural width.
the horizontal GtkScrollablePolicy
procedure Set_Vadjustment
(Self : Gtk_Scrollable;
Vadjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class)
Sets the vertical adjustment of the GtkScrollable.
a GtkAdjustment
procedure Set_Vscroll_Policy
(Self : Gtk_Scrollable;
Policy : Gtk.Enums.Gtk_Scrollable_Policy)
Sets the GtkScrollablePolicy. The policy determines whether vertical scrolling should start below the minimum height or below the natural height.
the vertical GtkScrollablePolicy
Vadjustment_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Adjustment.Gtk_Adjustment Vertical GtkAdjustment of the scrollable widget.
This adjustment is shared between the scrollable widget and its parent.
type Virtual_Get_Border is access function
(Self : Gtk_Scrollable;
Border : out Gtk_Border) return Glib.Gboolean;
Returns the size of a non-scrolling border around the outside of the scrollable. An example for this would be treeview headers. GTK can use this information to display overlaid graphics, like the overshoot indication, at the right position.
return location for the results
True if Border has been set
Vscroll_Policy_Property : constant Gtk.Enums.Property_Gtk_Scrollable_Policy;
Determines when vertical scrolling should start.