Gtk.Overlay

const Gtk = imports.gi.Gtk;

let overlay = new Gtk.Overlay();
  

GtkOverlay is a container which contains a single main child, on top of which it can place <firstterm>overlay</firstterm> widgets. The position of each overlay widget is determined by its Gtk.halign and Gtk.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 Gtk.get-child-position signal.

<refsect2 id="GtkOverlay-BUILDER-UI"> <title>GtkOverlay as GtkBuildable</title> <para> The GtkOverlay implementation of the GtkBuildable interface supports placing a child as an overlay by specifying "overlay" as the "type" attribute of a <tag class="starttag">child</tag> element. </para> </refsect2>

Hierarchy

  • GObject.Object
    • GObject.InitiallyUnowned
      • Gtk.Widget
        • Gtk.Container
          • Gtk.Bin
            • Gtk.Overlay