Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: PopupMeta

[179:14] static extends: object

Generated metadata helpers for Popup interface surfaces.

Methods

  • properties ()

    Returns property metadata for Popup.

    • @r A list.

class: Popup

[16:7] extends: object

A surface that is attached to another surface. The GdkPopup is positioned relative to its parent surface. GdkPopups are typically used to implement menus and similar popups. They can be modal, which is indicated by the [property@Gdk.Popup:autohide] property.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Popup (Handle = null)

    Creates a new Popup by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • get_autohide ()

    Returns whether this popup is set to hide on outside clicks.

  • get_parent ()

    Returns the parent surface of a popup.

  • get_position_x ()

    Obtains the position of the popup relative to its parent.

  • get_position_y ()

    Obtains the position of the popup relative to its parent.

  • get_rect_anchor ()

    Gets the current popup rectangle anchor. The value returned may change after calling [method@Gdk.Popup.present], or after the [signal@Gdk.Surface::layout] signal is emitted.

  • get_surface_anchor ()

    Gets the current popup surface anchor. The value returned may change after calling [method@Gdk.Popup.present], or after the [signal@Gdk.Surface::layout] signal is emitted.

  • present (int width, int height, object layout)

    Present @popup after having processed the GdkPopupLayout rules. If the popup was previously not showing, it will be shown, otherwise it will change position according to @layout. After calling this function, the result should be handled in response to the [signal@Gdk.Surface::layout] signal being emitted. The resulting popup position can be queried using [method@Gdk.Popup.get_position_x], [method@Gdk.Popup.get_position_y], and the resulting size will be sent as parameters in the layout signal. Use [method@Gdk.Popup.get_rect_anchor] and [method@Gdk.Popup.get_surface_anchor] to get the resulting anchors. Presenting may fail, for example if the @popup is set to autohide and is immediately hidden upon being presented. If presenting failed, the [signal@Gdk.Surface::layout] signal will not me emitted.

    • @p width is the unconstrained popup width to layout.
    • @p height is the unconstrained popup height to layout.
    • @p layout is the GdkPopupLayout object used to layout.