Top |
Functions
gboolean | gdk_popup_present () |
GdkGravity | gdk_popup_get_surface_anchor () |
GdkGravity | gdk_popup_get_rect_anchor () |
GdkSurface * | gdk_popup_get_parent () |
int | gdk_popup_get_position_x () |
int | gdk_popup_get_position_y () |
gboolean | gdk_popup_get_autohide () |
Properties
gboolean | autohide | Read / Write / Construct Only |
GdkSurface * | parent | Read / Write / Construct Only |
Description
A GdkPopup is a surface that is attached to another surface, called its “parent”, and is positioned relative to it.
GdkPopups are typically used to implement menus and similar popups. They can be modal, which is indicated by the “autohide” property.
Functions
gdk_popup_present ()
gboolean gdk_popup_present (GdkPopup *popup
,int width
,int height
,GdkPopupLayout *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 “layout” signal being emitted. The resulting popup
position can be queried using gdk_popup_get_position_x()
,
gdk_popup_get_position_y()
, and the resulting size will be sent as
parameters in the layout signal. Use gdk_popup_get_rect_anchor()
and
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 “layout” signal will not me emitted.
Parameters
popup |
the GdkPopup to show |
|
width |
the unconstrained popup width to layout |
|
height |
the unconstrained popup height to layout |
|
layout |
the GdkPopupLayout object used to layout |
gdk_popup_get_surface_anchor ()
GdkGravity
gdk_popup_get_surface_anchor (GdkPopup *popup
);
Gets the current popup surface anchor.
The value returned may change after calling gdk_popup_present()
,
or after the “layout” signal is emitted.
gdk_popup_get_rect_anchor ()
GdkGravity
gdk_popup_get_rect_anchor (GdkPopup *popup
);
Gets the current popup rectangle anchor.
The value returned may change after calling gdk_popup_present()
,
or after the “layout” signal is emitted.
gdk_popup_get_parent ()
GdkSurface *
gdk_popup_get_parent (GdkPopup *popup
);
Returns the parent surface of a popup.
gdk_popup_get_position_x ()
int
gdk_popup_get_position_x (GdkPopup *popup
);
Obtains the position of the popup relative to its parent.
gdk_popup_get_position_y ()
int
gdk_popup_get_position_y (GdkPopup *popup
);
Obtains the position of the popup relative to its parent.
Property Details
The “autohide”
property
“autohide” gboolean
Whether to hide on outside clicks.
Owner: GdkPopup
Flags: Read / Write / Construct Only
Default value: FALSE
The “parent”
property
“parent” GdkSurface *
The parent surface.
Owner: GdkPopup
Flags: Read / Write / Construct Only