Package ch.bailu.gtk.gdk
Class Popup
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.Interface
ch.bailu.gtk.gdk.Popup
- All Implemented Interfaces:
PointerInterface
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.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether this popup is set to hide on outside clicks.static ClassHandler
static int
Returns the parent surface of a popup.static long
static TypeSystem.TypeSize
int
Obtains the position of the popup relative to its parent.int
Obtains the position of the popup relative to its parent.int
Gets the current popup rectangle anchor.int
Gets the current popup surface anchor.static long
static TypeSystem.TypeSize
boolean
present
(int width, int height, PopupLayout layout) Present @popup after having processed the `GdkPopupLayout` rules.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
Popup
-
-
Method Details
-
getClassHandler
-
getAutohide
public boolean getAutohide()Returns whether this popup is set to hide on outside clicks.- Returns:
- %TRUE if @popup will autohide
-
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
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 layoutheight
- the unconstrained popup height to layoutlayout
- 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
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-