Gnome::Gtk4::R-Scrollable
Description
Gnome::Gtk4::R-Scrollable is an interface for widgets with native scrolling ability.
To implement this interface you should override the hadjustment and 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 value-changed defined in Adjustment 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 [vfunc
$Gtk
.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 [vfunc
$Gtk
.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
.configure() in class Gnome::Gtk4::Adjustment
.When any of the adjustments emits the value-changed defined in Adjustment signal, the scrollable widget should scroll its contents.
Methods
get-border
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.
method get-border ( N-Object $border --> Bool )
$border; return location for the results
Return value; True
if $border
has been set.
get-hadjustment
Retrieves the Gnome::Gtk4::Adjustment used for horizontal scrolling.
method get-hadjustment (--> N-Object )
Return value; horizontal Gnome::Gtk4::Adjustment..
get-hscroll-policy
Gets the horizontal enumeration GtkScrollablePolicy defined in Gnome::Gtk4::T-enums
.
method get-hscroll-policy (--> GtkScrollablePolicy )
Return value; The horizontal enumeration GtkScrollablePolicy defined in Gnome::Gtk4::T-enums
..
get-vadjustment
Retrieves the Gnome::Gtk4::Adjustment used for vertical scrolling.
method get-vadjustment (--> N-Object )
Return value; vertical Gnome::Gtk4::Adjustment..
get-vscroll-policy
Gets the vertical enumeration GtkScrollablePolicy defined in Gnome::Gtk4::T-enums
.
method get-vscroll-policy (--> GtkScrollablePolicy )
Return value; The vertical enumeration GtkScrollablePolicy defined in Gnome::Gtk4::T-enums
..
set-hadjustment
Sets the horizontal adjustment of the Gnome::Gtk4::R-Scrollable.
method set-hadjustment ( N-Object() $hadjustment )
$hadjustment; a Gnome::Gtk4::Adjustment.
set-hscroll-policy
Sets the enumeration GtkScrollablePolicy defined in Gnome::Gtk4::T-enums
.
The policy determines whether horizontal scrolling should start below the minimum width or below the natural width.
method set-hscroll-policy ( GtkScrollablePolicy $policy )
$policy; the horizontal
enumeration GtkScrollablePolicy defined in Gnome::Gtk4::T-enums
.
set-vadjustment
Sets the vertical adjustment of the Gnome::Gtk4::R-Scrollable.
method set-vadjustment ( N-Object() $vadjustment )
$vadjustment; a Gnome::Gtk4::Adjustment.
set-vscroll-policy
Sets the enumeration GtkScrollablePolicy defined in Gnome::Gtk4::T-enums
.
The policy determines whether vertical scrolling should start below the minimum height or below the natural height.
method set-vscroll-policy ( GtkScrollablePolicy $policy )
$policy; the vertical
enumeration GtkScrollablePolicy defined in Gnome::Gtk4::T-enums
.