Gtk.Overlay

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

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 Gtk.Widget.Gtk_Widget:halign and Gtk.Widget.Gtk_Widget:valign properties. E.g. a widget with both alignments set to Gtk.Widget.Align_Start will be placed at the top left corner of the GtkOverlay container, whereas an overlay with halign set to Gtk.Widget.Align_Center and valign set to Gtk.Widget.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 Gtk.Overlay.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.

"+"

function "+"
  (Widget : access Gtk_Overlay_Record'Class)
return Gtk.Buildable.Gtk_Buildable
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Overlay
Parameters
Interf
Return Value

Add_Overlay

procedure Add_Overlay
   (Self   : not null access Gtk_Overlay_Record;
    Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class)

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 Gtk.Widget.Gtk_Widget:halign and Gtk.Widget.Gtk_Widget:valign properties. Since: gtk+ 3.2

Parameters
Self
Widget

a Gtk.Widget.Gtk_Widget to be added to the container

Cb_GObject_Gtk_Widget_Gdk_Rectangle_Boolean

type Cb_GObject_Gtk_Widget_Gdk_Rectangle_Boolean is not null access function
  (Self       : access Glib.Object.GObject_Record'Class;
   Widget     : not null access Gtk.Widget.Gtk_Widget_Record'Class;
   Allocation : access Gdk.Rectangle.Gdk_Rectangle)
return Boolean;
Parameters
Self
Widget
Allocation
Return Value

Cb_Gtk_Overlay_Gtk_Widget_Gdk_Rectangle_Boolean

type Cb_Gtk_Overlay_Gtk_Widget_Gdk_Rectangle_Boolean is not null access function
  (Self       : access Gtk_Overlay_Record'Class;
   Widget     : not null access Gtk.Widget.Gtk_Widget_Record'Class;
   Allocation : access Gdk.Rectangle.Gdk_Rectangle)
return Boolean;
Parameters
Self
Widget
Allocation
Return Value

Get_Overlay_Pass_Through

function Get_Overlay_Pass_Through
   (Self   : not null access Gtk_Overlay_Record;
    Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class)
    return Boolean

Convenience function to get the value of the Gtk.Overlay.Gtk_Overlay:pass-through child property for Widget. Since: gtk+ 3.18

Parameters
Self
Widget

an overlay child of Gtk.Overlay.Gtk_Overlay

Return Value

whether the widget is a pass through child.

Get_Type

function Get_Type return Glib.GType
Return Value

Gtk_New

procedure Gtk_New (Self : out Gtk_Overlay)

Creates a new Gtk.Overlay.Gtk_Overlay. Since: gtk+ 3.2 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Self

Gtk_Overlay

type Gtk_Overlay is access all Gtk_Overlay_Record'Class;

Gtk_Overlay_New

function Gtk_Overlay_New return Gtk_Overlay

Creates a new Gtk.Overlay.Gtk_Overlay. Since: gtk+ 3.2

Return Value

Gtk_Overlay_Record

type Gtk_Overlay_Record is new Gtk_Bin_Record with null record;

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Overlay_Record, Gtk_Overlay);

Initialize

procedure Initialize (Self : not null access Gtk_Overlay_Record'Class)

Creates a new Gtk.Overlay.Gtk_Overlay. Since: gtk+ 3.2 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Self

On_Get_Child_Position

procedure On_Get_Child_Position
   (Self  : not null access Gtk_Overlay_Record;
    Call  : Cb_GObject_Gtk_Widget_Gdk_Rectangle_Boolean;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

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.Widget.Align_Fill will cause the overlay to be full-width/height). If the main child is a Gtk.Scrolled_Window.Gtk_Scrolled_Window, the overlays are placed relative to its contents.

Callback parameters: -- @param Widget the child widget to position -- @param Allocation return location for the allocation

Parameters
Self
Call
Slot
After

On_Get_Child_Position

procedure On_Get_Child_Position
   (Self  : not null access Gtk_Overlay_Record;
    Call  : Cb_Gtk_Overlay_Gtk_Widget_Gdk_Rectangle_Boolean;
    After : Boolean := False)

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.Widget.Align_Fill will cause the overlay to be full-width/height). If the main child is a Gtk.Scrolled_Window.Gtk_Scrolled_Window, the overlays are placed relative to its contents.

Callback parameters: -- @param Widget the child widget to position -- @param Allocation return location for the allocation

Parameters
Self
Call
After

Reorder_Overlay

procedure Reorder_Overlay
   (Self  : not null access Gtk_Overlay_Record;
    Child : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Index : Glib.Gint)

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 by default. See also Gtk.Overlay.Gtk_Overlay:index. A widget's index in the Overlay children list determines which order the children are drawn if they overlap. The first child is drawn at the bottom. It also affects the default focus chain order. Since: gtk+ 3.18

Parameters
Self
Child

the overlaid Gtk.Widget.Gtk_Widget to move

Index

the new index for Child in the list of overlay children of Overlay, starting from 0. If negative, indicates the end of the list

Set_Overlay_Pass_Through

procedure Set_Overlay_Pass_Through
   (Self         : not null access Gtk_Overlay_Record;
    Widget       : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Pass_Through : Boolean)

Convenience function to set the value of the Gtk.Overlay.Gtk_Overlay:pass-through child property for Widget. Since: gtk+ 3.18

Parameters
Self
Widget

an overlay child of Gtk.Overlay.Gtk_Overlay

Pass_Through

whether the child should pass the input through

Signal_Get_Child_Position

Signal_Get_Child_Position : constant Glib.Signal_Name := "get-child-position";

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.Widget.Align_Fill will cause the overlay to be full-width/height). If the main child is a Gtk.Scrolled_Window.Gtk_Scrolled_Window, the overlays are placed relative to its contents.

Callback parameters: -- @param Widget the child widget to position -- @param Allocation return location for the allocation