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.
bool equal(gdk.popup_layout.PopupLayout other) nothrowCheck whether layout and other has identical layout properties.gdk.types.AnchorHints getAnchorHints() nothrowGet the [gdk.types.AnchorHints]. Returns: the [gdk.types.AnchorHints]gdk.rectangle.Rectangle getAnchorRect() nothrowGet the anchor rectangle. Returns: The anchor rectanglegdk.types.Gravity getRectAnchor() nothrowReturns 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) nothrowObtains the shadow widths of this layout.gdk.types.Gravity getSurfaceAnchor() nothrowReturns the anchor position on the popup surface. Returns: the anchor on the popup surface.void setOffset(int dx, int dy) nothrowOffset the position of the anchor rectangle with the given delta.void setShadowWidth(int left, int right, int top, int bottom) nothrowSets the shadow width of the popup.this(gdk.rectangle.Rectangle anchorRect, gdk.types.Gravity rectAnchor, gdk.types.Gravity surfaceAnchor)Create a popup layout description.