Class Popup

All Implemented Interfaces:
PointerInterface

public class Popup extends Interface
A `GdkPopup` is a surface that is attached to another surface.

The `GdkPopup` is positioned relative to its parent surface.

`GdkPopup`s are typically used to implement menus and similar popups.
They can be modal, which is indicated by the [property@GdkPopup:autohide]
property.

https://docs.gtk.org/gdk4/iface.Popup.html

  • Constructor Details

  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getAutohide

      public boolean getAutohide()
      Returns whether this popup is set to hide on outside clicks.
      Returns:
      %TRUE if @popup will autohide
    • getParent

      public Surface getParent()
      Returns the parent surface of a popup.
      Returns:
      the parent surface
    • getPositionX

      public int getPositionX()
      Obtains the position of the popup relative to its parent.
      Returns:
      the X coordinate of @popup position
    • getPositionY

      public int getPositionY()
      Obtains the position of the popup relative to its parent.
      Returns:
      the Y coordinate of @popup position
    • getRectAnchor

      public int getRectAnchor()
      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.
      Returns:
      the current rectangle anchor value of @popup
    • getSurfaceAnchor

      public int getSurfaceAnchor()
      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.
      Returns:
      the current surface anchor value of @popup
    • present

      public boolean present(int width, int height, @Nonnull PopupLayout layout)
      Present @popup after having processed the `GdkPopupLayout` rules.

      If the popup was previously now showing, it will be showed,
      otherwise it will change position according to @layout.

      After calling this function, the result should be handled in response
      to the [signal@GdkSurface::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.
      Parameters:
      width - the unconstrained popup width to layout
      height - the unconstrained popup height to layout
      layout - the `GdkPopupLayout` object used to layout
      Returns:
      %FALSE if it failed to be presented, otherwise %TRUE.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()