Package: gtk

Class gtk-overlay

Superclasses

gtk-bin, gtk-container, gtk-widget, gtk-buildable, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

None

Details

The gtk-overlay widget is a container which contains a single main widget, on top of which it can place overlay widgets. The position of each overlay widget is determined by its halign and valign properties. E.g. a overlay widget with both alignments set to :start will be placed at the top left corner of the main widget, whereas an overlay with the halign property set to :center and the valign property set to :end will be placed a the bottom edge of the main widget, horizontally centered. The position can be adjusted by setting the margin properties of the overlay widget to non-zero values.

More complicated placement of overlays is possible by connecting to the "get-child-position" signal.

GtkOverlay as GtkBuildable

The gtk-overlay implementation of the gtk-buildable interface supports placing a child widget as an overlay by specifying "overlay" as the "type" attribute of a <child> element.

CSS nodes

The gtk-overlay implementation has a single CSS node with the name overlay. Overlay children whose alignments cause them to be positioned at an edge get the .left, .right, .top, and/or .bottom style classes according to their position.

Child Property Details

index
The index child property of type :int (Read / Write)
The index of the overlay in the parent, -1 for the main child. Since 3.18
Allowed values: >= -1
Default value: 0
pass-through
The pass-through child property of type :boolean (Read / Write)
Pass through input, does not affect main child. Since 3.18
Default value: false

Signal Details

The "get-child-position" signal
 lambda (overlay widget allocation)    :run-last      
The signal is 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 the overlay. The default handler for this signal uses the halign and valign properties of the widget to determine the position and gives the widget its natural size, except that an alignment of :fill will cause the overlay to be full-width/height. If the main child is a gtk-scrolled-window widget, the overlays are placed relative to its contents.
overlay
The gtk-overlay widget which emitted the signal.
widget
The gtk-widget child widget to position.
allocation
Return location of type gdk-rectangle for the allocation.
Returns
True if the allocation has been filled.
 

Inherited Slot Access Functions

See also

*2021-10-21