Interface Popup
- All Superinterfaces:
Proxy
- All Known Implementing Classes:
Popup.PopupImpl
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 Gdk.Popup:autohide
property.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Popup.Builder<B extends Builder<B>>
static class
The PopupImpl type represents a native instance of the Popup interface.static class
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Returns whether this popup is set to hide on outside clicks.default 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 Type
getType()
Get the GType of the Popup classdefault boolean
present
(int width, int height, PopupLayout layout) Present this Popup after having processed theGdkPopupLayout
rules.
-
Method Details
-
getType
-
getAutohide
default boolean getAutohide()Returns whether this popup is set to hide on outside clicks.- Returns:
true
if this Popup will autohide
-
getParent
-
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
Gets the current popup rectangle anchor.The value returned may change after calling
present(int, int, org.gnome.gdk.PopupLayout)
, or after theGdk.Surface::layout
signal is emitted.- Returns:
- the current rectangle anchor value of this Popup
-
getSurfaceAnchor
Gets the current popup surface anchor.The value returned may change after calling
present(int, int, org.gnome.gdk.PopupLayout)
, or after theGdk.Surface::layout
signal is emitted.- Returns:
- the current surface anchor value of this Popup
-
present
Present this Popup after having processed theGdkPopupLayout
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 usinggetPositionX()
,getPositionY()
, and the resulting size will be sent as parameters in the layout signal. UsegetRectAnchor()
andgetSurfaceAnchor()
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 layoutheight
- the unconstrained popup height to layoutlayout
- theGdkPopupLayout
object used to layout- Returns:
false
if it failed to be presented, otherwisetrue
.
-