Basics
Guides
API Reference
Basics
Guides
API Reference
[31:7] extends: object
Places “overlay” widgets on top of a single main child.
GtkOverlay container, whereas an overlay with halign set to
%GTK_ALIGN_CENTER and valign set to %GTK_ALIGN_END will be placed a the
bottom edge of the GtkOverlay, horizontally centered. The position can be
adjusted by setting the margin properties of the child to non-zero values.
More complicated placement of overlays is possible by connecting to the
[signal@Gtk.Overlay::get-child-position] signal. An overlay’s minimum and
natural sizes are those of its main child. The sizes of overlay children are
not considered when measuring these preferred sizes. # GtkOverlay as
GtkBuildable The GtkOverlay implementation of the GtkBuildable interface
supports placing a child as an overlay by specifying “overlay” as the “type”
attribute of a <child> element. # CSS nodes GtkOverlay has a single CSS
node with the name “overlay”. Overlay children whose alignments cause them to
be positioned at an edge get the style classes “.left”, “.right”, “.top”,
and/or “.bottom” according to their position.
GtkOverlay (Handle = null)
Creates a new
GtkOverlay.
Handle is an optional native handle or wrapper whose handle to adopt; when the native constructor is called.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asWidget ()
Wraps this handle as
GtkWidget.
A GtkWidget object.asAccessible ()
Wraps this handle as
GtkAccessible.
A GtkAccessible object.asBuildable ()
Wraps this handle as
GtkBuildable.
A GtkBuildable object.asConstraintTarget ()
Wraps this handle as
GtkConstraintTarget.
A GtkConstraintTarget object.connectSignal (string Name, CallbackObj)
Connects one generated callback wrapper to a named signal.
Name is the signal name.CallbackObj is the generated callback wrapper to connect.The connected handler id.disconnectSignalHandler (int HandlerId)
Disconnects one retained signal handler id.
HandlerId is the signal handler id to disconnect.None.setOnGetchildposition (callback Fn, UserData = null)
Emitted to determine the position and size of any overlay child widgets. A handler for this signal should fill @allocation with the desired position and size for @widget, relative to the 'main' child of @overlay. The default handler for this signal uses the @widget's halign and valign properties to determine the position and gives the widget its natural size (except that an alignment of %GTK_ALIGN_FILL will cause the overlay to be full-width/height). If the main child is a
GtkScrolledWindow, the overlays are placed relative to its contents.
Fn is the Aussom callback.Fn is called with (GtkOverlay Self, GtkWidget Widget, GdkRectangle Allocation).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setChild (object Value)
The main child widget.
Value is the new property value.None.add_overlay (object widget)
Adds @widget to @overlay. The widget will be stacked on top of the main widget added with [method@Gtk.Overlay.set_child]. The position at which
is placed is determined from its [property@Gtk.Widget:halign] and [property@Gtk.Widget:valign] properties.widget is a GtkWidget to be added to the container.None.get_child ()
Gets the child widget of @overlay.
the child widget of @overlay.get_clip_overlay (object widget)
Gets whether @widget should be clipped within the parent.
widget is an overlay child of GtkOverlay.whether the widget is clipped within the parent..get_measure_overlay (object widget)
Gets whether @widget's size is included in the measurement of @overlay.
widget is an overlay child of GtkOverlay.whether the widget is measured.remove_overlay (object widget)
Removes an overlay that was added with gtk_overlay_add_overlay().
widget is a GtkWidget to be removed.None.set_child (object child)
Sets the child widget of @overlay.
child is the child widget.None.set_clip_overlay (object widget, bool clip_overlay)
Sets whether @widget should be clipped within the parent.
widget is an overlay child of GtkOverlay.clip_overlay is whether the child should be clipped.None.set_measure_overlay (object widget, bool measure)
Sets whether @widget is included in the measured size of @overlay. The overlay will request the size of the largest child that has this property set to %TRUE. Children who are not included may be drawn outside of
allocation if they are too large.widget is an overlay child of GtkOverlay.measure is whether the child should be measured.None.[403:14] static extends: object
Generated metadata helpers for Overlay class surfaces.
properties ()
Returns property metadata for
Overlay.
A list.signals ()
Returns signal metadata for
Overlay.
A list.[324:7] extends: object
Generated low-level callback wrapper for GIR callback get-child-position.
GtkOverlayGetchildpositionCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, widget, allocation, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.

Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.