Gdk.Popup¶
interface
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 Popup.autohide
property.
Methods¶
get_autohide¶
Returns whether this popup is set to hide on outside clicks.
get_parent¶
Returns the parent surface of a popup.
get_position_x¶
Obtains the position of the popup relative to its parent.
get_position_y¶
Obtains the position of the popup relative to its parent.
get_rect_anchor¶
Gets the current popup rectangle anchor.
The value returned may change after calling Popup.present,
or after the Surface.layout signal is emitted.
get_surface_anchor¶
Gets the current popup surface anchor.
The value returned may change after calling Popup.present,
or after the Surface.layout signal is emitted.
present¶
Present 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 Surface.layout signal being emitted. The resulting
popup position can be queried using Popup.get_position_x,
Popup.get_position_y, and the resulting size will be sent as
parameters in the layout signal. Use Popup.get_rect_anchor
and 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 Surface.layout signal will not me emitted.
Parameters:
width— the unconstrained popup width to layoutheight— the unconstrained popup height to layoutlayout— theGdkPopupLayoutobject used to layout
Properties¶
autohide¶
Whether to hide on outside clicks.
parent¶
The parent surface.