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 "halign" and "valign" properties. E.g. a widget with both alignments set to GTK_ALIGN_START will be placed at the top left corner of the main widget, 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 main widget, 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 "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.

Constructors

this
this(GtkOverlay* gtkOverlay)

Sets our main struct and passes it to the parent class

this
this()

Creates a new GtkOverlay.

Members

Functions

addOnGetChildPosition
void 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. 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. Return: TRUE if the allocation has been filled

addOverlay
void addOverlay(Widget widget)

Adds widget to overlay. The widget will be stacked on top of the main widget added with gtk_container_add(). The position at which widget is placed is determined from its "halign" and "valign" properties.

getOverlayStruct
GtkOverlay* getOverlayStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

callBackGetChildPosition
gboolean callBackGetChildPosition(GtkOverlay* overlayStruct, GtkWidget* widget, GdkRectangle* allocation, Overlay _overlay)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

connectedSignals
int[string] connectedSignals;
gtkOverlay
GtkOverlay* gtkOverlay;

the main Gtk struct

onGetChildPositionListeners
bool delegate(Widget, GdkRectangle*, Overlay)[] onGetChildPositionListeners;
Undocumented in source.

Inherited Members

From Bin

gtkBin
GtkBin* gtkBin;

the main Gtk struct

getBinStruct
GtkBin* getBinStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
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