Interface Popup

All Superinterfaces:
Proxy
All Known Implementing Classes:
Popup.Popup$Impl

@Generated("org.javagi.JavaGI") public interface Popup extends Proxy

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 Gdk.Popup:autohide property.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
    static class 
    The Popup$Impl type represents a native instance of the Popup interface.
    static class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns whether this popup is set to hide on outside clicks.
    default @Nullable Surface
    Returns the parent surface of a popup.
    default int
    Obtains the position of the popup relative to its parent.
    default int
    Obtains the position of the popup relative to its parent.
    default Gravity
    Gets the current popup rectangle anchor.
    default Gravity
    Gets the current popup surface anchor.
    static @Nullable Type
    Get the GType of the Popup class.
    default boolean
    present(int width, int height, PopupLayout layout)
    Present this Popup after having processed the GdkPopupLayout rules.

    Methods inherited from interface Proxy

    handle
  • Method Details

    • getType

      static @Nullable Type getType()
      Get the GType of the Popup class.
      Returns:
      the GType
    • getAutohide

      default boolean getAutohide()
      Returns whether this popup is set to hide on outside clicks.
      Returns:
      true if this Popup will autohide
    • getParent

      default @Nullable Surface getParent()
      Returns the parent surface of a popup.
      Returns:
      the parent surface
    • getPositionX

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

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

      default Gravity getRectAnchor()

      Gets the current popup rectangle anchor.

      The value returned may change after calling present(int, int, PopupLayout), or after the Gdk.Surface::layout signal is emitted.

      Returns:
      the current rectangle anchor value of this Popup
    • getSurfaceAnchor

      default Gravity getSurfaceAnchor()

      Gets the current popup surface anchor.

      The value returned may change after calling present(int, int, PopupLayout), or after the Gdk.Surface::layout signal is emitted.

      Returns:
      the current surface anchor value of this Popup
    • present

      default boolean present(int width, int height, PopupLayout layout)

      Present this 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 Gdk.Surface::layout signal being emitted. The resulting popup position can be queried using getPositionX(), getPositionY(), and the resulting size will be sent as parameters in the layout signal. Use getRectAnchor() and getSurfaceAnchor() to get the resulting anchors.

      Presenting may fail, for example if the this Popup is set to autohide and is immediately hidden upon being presented. If presenting failed, the 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.