gdk.popup_layout
Module for [PopupLayout] class
Types 1
The [gdk.popup_layout.PopupLayout] struct contains information that is necessary position a [gdk.popup.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 [gdk.popup.Popup.getPositionX], [gdk.popup.Popup.getPositionY], [gdk.popup.Popup.getRectAnchor] and [gdk.popup.Popup.getSurfaceAnchor] 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.
PopupLayout self()Returns `this`, for use in `with` statements.gdk.popup_layout.PopupLayout copy()Makes a copy of layout. Returns: a copy of layout.bool equal(gdk.popup_layout.PopupLayout other)Check whether layout and other has identical layout properties.gdk.types.AnchorHints getAnchorHints()Get the [gdk.types.AnchorHints]. Returns: the [gdk.types.AnchorHints]gdk.rectangle.Rectangle getAnchorRect()Get the anchor rectangle. Returns: The anchor rectanglevoid getOffset(out int dx, out int dy)Retrieves the offset for the anchor rectangle.gdk.types.Gravity getRectAnchor()Returns the anchor position on the anchor rectangle. Returns: the anchor on the anchor rectangle.void getShadowWidth(out int left, out int right, out int top, out int bottom)Obtains the shadow widths of this layout.gdk.types.Gravity getSurfaceAnchor()Returns the anchor position on the popup surface. Returns: the anchor on the popup surface.void setAnchorHints(gdk.types.AnchorHints anchorHints)Set new anchor hints.void setAnchorRect(gdk.rectangle.Rectangle anchorRect)Set the anchor rectangle.void setOffset(int dx, int dy)Offset the position of the anchor rectangle with the given delta.void setRectAnchor(gdk.types.Gravity anchor)Set the anchor on the anchor rectangle.void setShadowWidth(int left, int right, int top, int bottom)Sets the shadow width of the popup.void setSurfaceAnchor(gdk.types.Gravity anchor)Set the anchor on the popup surface.this(gdk.rectangle.Rectangle anchorRect, gdk.types.Gravity rectAnchor, gdk.types.Gravity surfaceAnchor)Create a popup layout description.