Module: Gdk::Popup
- Defined in:
- (unknown)
Overview
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 [propertyGdk.Popup:autohide]
property.
Instance Method Summary collapse
-
#autohide ⇒ Boolean
Returns whether this popup is set to hide on outside clicks.
-
#parent ⇒ Gdk::Surface
Returns the parent surface of a popup.
-
#position_x ⇒ Integer
Obtains the position of the popup relative to its parent.
-
#position_y ⇒ Integer
Obtains the position of the popup relative to its parent.
-
#present(width, height, layout) ⇒ Boolean
Present popup after having processed the
GdkPopupLayoutrules. -
#rect_anchor ⇒ Gdk::Gravity
Gets the current popup rectangle anchor.
-
#surface_anchor ⇒ Gdk::Gravity
Gets the current popup surface anchor.
Instance Method Details
#autohide ⇒ Boolean
Returns whether this popup is set to hide on outside clicks.
#parent ⇒ Gdk::Surface
Returns the parent surface of a popup.
#position_x ⇒ Integer
Obtains the position of the popup relative to its parent.
#position_y ⇒ Integer
Obtains the position of the popup relative to its parent.
#present(width, height, layout) ⇒ Boolean
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 [signalGdk.Surface::layout] signal being emitted. The resulting popup position can be queried using [methodGdk.Popup.get_position_x], [methodGdk.Popup.get_position_y], and the resulting size will be sent as parameters in the layout signal. Use [methodGdk.Popup.get_rect_anchor] and [methodGdk.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 [signalGdk.Surface::layout] signal will not me emitted.
#rect_anchor ⇒ Gdk::Gravity
Gets the current popup rectangle anchor.
The value returned may change after calling [methodGdk.Popup.present], or after the [signalGdk.Surface::layout] signal is emitted.
#surface_anchor ⇒ Gdk::Gravity
Gets the current popup surface anchor.
The value returned may change after calling [methodGdk.Popup.present], or after the [signalGdk.Surface::layout] signal is emitted.