Gnome::Gtk4::CustomLayout
Description
Gnome::Gtk4::CustomLayout uses closures for size negotiation.
A Gnome::Gtk4::CustomLayout uses closures matching to the old Gnome::Gtk4::Widget virtual functions for size negotiation, as a convenience API to ease the porting towards the corresponding Gnome::Gtk4::LayoutManager virtual functions.
Class initialization
new
:native-object
Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object :$native-object! )
new-customlayout
Creates a new legacy layout manager.
Legacy layout managers map to the old Gnome::Gtk4::Widget size negotiation virtual functions, and are meant to be used during the transition from layout containers to layout manager delegates.
method new-customlayout ( &request-mode, &measure, &allocate --> Gnome::Gtk4::CustomLayout \)
&request-mode; a function to retrieve the
enumeration GtkSizeRequestMode defined in Gnome::Gtk4::T-enums
of the widget using the layout; the default request mode isGTK_SIZE_REQUEST_CONSTANT_SIZE
. Tthe function must be specified with following signature;:( N-Object $widget --
GEnum )>.&measure; a function to measure the widget using the layout manager. Tthe function must be specified with following signature;
:( N-Object $widget, GEnum $orientation, gint $for-size, gint-ptr $minimum, gint-ptr $natural, gint-ptr $minimum-baseline, gint-ptr $natural-baseline )
.&allocate; a function to allocate the children of the widget using the layout manager. Tthe function must be specified with following signature;
:( N-Object $widget, gint $width, gint $height, gint $baseline )
.