Struct

GdkPopupLayout

Description [src]

struct GdkPopupLayout {
  /* No available fields */
}

The GdkPopupLayout struct contains information that is necessary position a GdkPopup 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.

Popup anchors

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.

Flipping popups

Sliding popups

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_get_position_x(), gdk_popup_get_position_y(), gdk_popup_get_rect_anchor() and gdk_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.

Constructors

gdk_popup_layout_new

Create a popup layout description.

Instance methods

gdk_popup_layout_copy

Makes a copy of layout.

gdk_popup_layout_equal

Check whether layout and other has identical layout properties.

gdk_popup_layout_get_anchor_hints

Get the GdkAnchorHints.

gdk_popup_layout_get_anchor_rect

Get the anchor rectangle.

gdk_popup_layout_get_offset

Retrieves the offset for the anchor rectangle.

gdk_popup_layout_get_rect_anchor

Returns the anchor position on the anchor rectangle.

gdk_popup_layout_get_shadow_width

Obtains the shadow widths of this layout.

since: 4.2

gdk_popup_layout_get_surface_anchor

Returns the anchor position on the popup surface.

gdk_popup_layout_ref

Increases the reference count of value.

gdk_popup_layout_set_anchor_hints

Set new anchor hints.

gdk_popup_layout_set_anchor_rect

Set the anchor rectangle.

gdk_popup_layout_set_offset

Offset the position of the anchor rectangle with the given delta.

gdk_popup_layout_set_rect_anchor

Set the anchor on the anchor rectangle.

gdk_popup_layout_set_shadow_width

Sets the shadow width of the popup.

since: 4.2

gdk_popup_layout_set_surface_anchor

Set the anchor on the popup surface.

gdk_popup_layout_unref

Decreases the reference count of value.