Method

GtkMenupopup_at_rect

since: 3.22

Declaration [src]

void
gtk_menu_popup_at_rect (
  GtkMenu* menu,
  GdkWindow* rect_window,
  const GdkRectangle* rect,
  GdkGravity rect_anchor,
  GdkGravity menu_anchor,
  const GdkEvent* trigger_event
)

Description [src]

Displays menu and makes it available for selection.

See gtk_menu_popup_at_widget () and gtk_menu_popup_at_pointer (), which handle more common cases for popping up menus.

menu will be positioned at rect, aligning their anchor points. rect is relative to the top-left corner of rect_window. rect_anchor and menu_anchor determine anchor points on rect and menu to pin together. menu can optionally be offset by GtkMenu:rect-anchor-dx and GtkMenu:rect-anchor-dy.

Anchors should be specified under the assumption that the text direction is left-to-right; they will be flipped horizontally automatically if the text direction is right-to-left.

Other properties that influence the behaviour of this function are GtkMenu:anchor-hints and GtkMenu:menu-type-hint. Connect to the GtkMenu::popped-up signal to find out how it was actually positioned.

Available since: 3.22

Parameters

rect_window

Type: GdkWindow

The GdkWindow rect is relative to.

The data is owned by the caller of the method.
rect

Type: GdkRectangle

The GdkRectangle to align menu with.

The data is owned by the caller of the method.
rect_anchor

Type: GdkGravity

The point on rect to align with menus anchor point.

menu_anchor

Type: GdkGravity

The point on menu to align with rects anchor point.

trigger_event

Type: GdkEvent

The GdkEvent that initiated this request or NULL if it’s the current event.

The argument can be NULL.
The data is owned by the caller of the method.