Overlay

GtkOverlay is a container which contains a single main child, on top of which it can place “overlay” widgets. The position of each overlay widget is determined by its #GtkWidget:halign and #GtkWidget:valign properties. E.g. a widget with both alignments set to %GTK_ALIGN_START will be placed at the top left corner of the 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 #GtkOverlay::get-child-position signal.

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.

Constructors

this
this(GtkOverlay* gtkOverlay, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new #GtkOverlay.

Members

Functions

addOnGetChildPosition
gulong addOnGetChildPosition(bool delegate(Widget, GdkRectangle*, Overlay) dlg, ConnectFlags connectFlags)

The ::get-child-position 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 @overlay.

addOverlay
void addOverlay(Widget widget)

Adds @widget to @overlay.

getOverlayPassThrough
bool getOverlayPassThrough(Widget widget)

Convenience function to get the value of the #GtkOverlay:pass-through child property for @widget.

getOverlayStruct
GtkOverlay* getOverlayStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

reorderOverlay
void reorderOverlay(Widget child, int position)

Moves @child to a new @index in the list of @overlay children. The list contains overlays in the order that these were added to @overlay.

setOverlayPassThrough
void setOverlayPassThrough(Widget widget, bool passThrough)

Convenience function to set the value of the #GtkOverlay:pass-through child property for @widget.

Static functions

getType
GType getType()

Variables

gtkOverlay
GtkOverlay* gtkOverlay;

the main Gtk struct

Inherited Members

From Bin

gtkBin
GtkBin* gtkBin;

the main Gtk struct

getBinStruct
GtkBin* getBinStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getChild
Widget getChild()

Gets the child of the #GtkBin, or %NULL if the bin contains no child widget. The returned widget does not have a reference added, so you do not need to unref it.

Meta