Popup#
- class Popup(*args, **kwargs)#
A GdkPopup is 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 autohide
property.
Methods#
- class Popup
-
- get_rect_anchor() Gravity#
Gets the current popup rectangle anchor.
The value returned may change after calling
present, or after thelayoutsignal is emitted.
- get_surface_anchor() Gravity#
Gets the current popup surface anchor.
The value returned may change after calling
present, or after thelayoutsignal is emitted.
- present(width: int, height: int, layout: PopupLayout) bool#
Present
popupafter having processed theGdkPopupLayoutrules.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
layoutsignal being emitted. The resulting popup position can be queried usingget_position_x,get_position_y, and the resulting size will be sent as parameters in the layout signal. Useget_rect_anchorandget_surface_anchorto get the resulting anchors.Presenting may fail, for example if the
popupis set to autohide and is immediately hidden upon being presented. If presenting failed, thelayoutsignal will not me emitted.- Parameters:
width – the unconstrained popup width to layout
height – the unconstrained popup height to layout
layout – the
GdkPopupLayoutobject used to layout