Contains information that is necessary position a [ifaceGdk.Popup] relative to its parent.
The positioning requires a negotiation with the windowing system, since it depends on external constraints, such as the position of the parent surface, and the screen dimensions.
The basic ingredients are a rectangle on the parent surface, and the anchor on both that rectangle and the popup. The anchors specify a side or corner to place next to each other.

For cases where placing the anchors next to each other would make the popup extend offscreen, the layout includes some hints for how to resolve this problem. The hints may suggest to flip the anchor position to the other side, or to 'slide' the popup along a side, or to resize it.


These hints may be combined.
Ultimatively, it is up to the windowing system to determine the position and size of the popup. You can learn about the result by calling [methodGdk.Popup.get_position_x], [methodGdk.Popup.get_position_y], [methodGdk.Popup.get_rect_anchor] and [methodGdk.Popup.get_surface_anchor] after the popup has been presented. This can be used to adjust the rendering. For example, GtkPopover changes its arrow position accordingly. But you have to be careful avoid changing the size of the popover, or it has to be presented again.
function Copy (Self : Gdk_Popup_Layout) return Gdk_Popup_Layout
Makes a copy of Layout.
a copy of Layout. Has transfer-ownership='full'.
function Equal
(Self : Gdk_Popup_Layout;
Other : Gdk_Popup_Layout) return Boolean
Check whether Layout and Other has identical layout properties.
another popup layout
true if Layout and Other have identical layout properties, otherwise false.
function From_Object (Object : System.Address) return Gdk_Popup_Layout
function From_Object_Free (B : access Gdk_Popup_Layout'Class) return Gdk_Popup_Layout
procedure Gdk_New
(Self : out Gdk_Popup_Layout;
Anchor_Rect : Gdk.Rectangle.Gdk_Rectangle;
Rect_Anchor : Gdk.Enums.Gdk_Gravity;
Surface_Anchor : Gdk.Enums.Gdk_Gravity)
Create a popup layout description. Used together with [methodGdk.Popup.present] to describe how a popup surface should be placed and behave on-screen. Anchor_Rect is relative to the top-left corner of the surface's parent. Rect_Anchor and Surface_Anchor determine anchor points on Anchor_Rect and surface to pin together. The position of Anchor_Rect's anchor point can optionally be offset using [methodGdk.PopupLayout.set_offset], which is equivalent to offsetting the position of surface.
the anchor rectangle to align Surface with
the point on Anchor_Rect to align with Surface's anchor point
the point on Surface to align with Rect's anchor point
type Gdk_Popup_Layout is new Glib.C_Boxed with null record;
function Gdk_Popup_Layout_New
(Anchor_Rect : Gdk.Rectangle.Gdk_Rectangle;
Rect_Anchor : Gdk.Enums.Gdk_Gravity;
Surface_Anchor : Gdk.Enums.Gdk_Gravity) return Gdk_Popup_Layout
Create a popup layout description. Used together with [methodGdk.Popup.present] to describe how a popup surface should be placed and behave on-screen. Anchor_Rect is relative to the top-left corner of the surface's parent. Rect_Anchor and Surface_Anchor determine anchor points on Anchor_Rect and surface to pin together. The position of Anchor_Rect's anchor point can optionally be offset using [methodGdk.PopupLayout.set_offset], which is equivalent to offsetting the position of surface.
the anchor rectangle to align Surface with
the point on Anchor_Rect to align with Surface's anchor point
the point on Surface to align with Rect's anchor point
function Get_Anchor_Hints
(Self : Gdk_Popup_Layout) return Gdk.Enums.Gdk_Anchor_Hints
Get the anchor hints.
the anchor hints
function Get_Anchor_Rect
(Self : Gdk_Popup_Layout) return access constant Gdk.Rectangle.Gdk_Rectangle
Get the anchor rectangle.
procedure Get_Offset
(Self : Gdk_Popup_Layout;
Dx : out Glib.Gint;
Dy : out Glib.Gint)
Retrieves the offset for the anchor rectangle.
return location for the delta X coordinate
return location for the delta Y coordinate
function Get_Rect_Anchor
(Self : Gdk_Popup_Layout) return Gdk.Enums.Gdk_Gravity
Returns the anchor position on the anchor rectangle.
the anchor on the anchor rectangle.
procedure Get_Shadow_Width
(Self : Gdk_Popup_Layout;
Left : out Glib.Gint;
Right : out Glib.Gint;
Top : out Glib.Gint;
Bottom : out Glib.Gint)
Obtains the shadow widths of this layout. Since: gtk+ 4.2
return location for the left shadow width
return location for the right shadow width
return location for the top shadow width
return location for the bottom shadow width
function Get_Surface_Anchor
(Self : Gdk_Popup_Layout) return Gdk.Enums.Gdk_Gravity
Returns the anchor position on the popup surface.
the anchor on the popup surface.
function Get_Type return Glib.GType
Null_Gdk_Popup_Layout : constant Gdk_Popup_Layout;
function Ref (Self : Gdk_Popup_Layout) return Gdk_Popup_Layout
Increases the reference count of Value.
the same Layout. Has transfer-ownership='full'.
procedure Set_Anchor_Hints
(Self : Gdk_Popup_Layout;
Anchor_Hints : Gdk.Enums.Gdk_Anchor_Hints)
Set new anchor hints. The set Anchor_Hints determines how Surface will be moved if the anchor points cause it to move off-screen. For example, GDK_ANCHOR_FLIP_X will replace GDK_GRAVITY_NORTH_WEST with GDK_GRAVITY_NORTH_EAST and vice versa if Surface extends beyond the left or right edges of the monitor.
the new anchor hints
procedure Set_Anchor_Rect
(Self : Gdk_Popup_Layout;
Anchor_Rect : not null access Gdk.Rectangle.Gdk_Rectangle)
Set the anchor rectangle.
the new anchor rectangle
procedure Set_Offset
(Self : Gdk_Popup_Layout;
Dx : Glib.Gint;
Dy : Glib.Gint)
Offset the position of the anchor rectangle with the given delta.
x delta to offset the anchor rectangle with
y delta to offset the anchor rectangle with
procedure Set_Rect_Anchor
(Self : Gdk_Popup_Layout;
Anchor : Gdk.Enums.Gdk_Gravity)
Set the anchor on the anchor rectangle.
the new rect anchor
procedure Set_Shadow_Width
(Self : Gdk_Popup_Layout;
Left : Glib.Gint;
Right : Glib.Gint;
Top : Glib.Gint;
Bottom : Glib.Gint)
Sets the shadow width of the popup. The shadow width corresponds to the part of the computed surface size that would consist of the shadow margin surrounding the window, would there be any. Since: gtk+ 4.2
width of the left part of the shadow
width of the right part of the shadow
height of the top part of the shadow
height of the bottom part of the shadow
procedure Set_Surface_Anchor
(Self : Gdk_Popup_Layout;
Anchor : Gdk.Enums.Gdk_Gravity)
Set the anchor on the popup surface.
the new popup surface anchor
procedure Unref (Self : Gdk_Popup_Layout)
Decreases the reference count of Value.