Gdk.Popup¶
- Implementations:
None
Methods¶
|
|
|
|
|
Virtual Methods¶
None
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|||
r/w/co |
Signals¶
None
Fields¶
None
Class Details¶
- class Gdk.Popup¶
- Bases:
- Structure:
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`Gdk`.Popup:autohide] property.
- get_parent()[source]¶
- Returns:
the parent surface
- Return type:
Gdk.Surface
orNone
Returns the parent surface of a popup.
- get_position_x()[source]¶
- Returns:
the X coordinate of self position
- Return type:
Obtains the position of the popup relative to its parent.
- get_position_y()[source]¶
- Returns:
the Y coordinate of self position
- Return type:
Obtains the position of the popup relative to its parent.
- get_rect_anchor()[source]¶
- Returns:
the current rectangle anchor value of self
- Return type:
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.
- get_surface_anchor()[source]¶
- Returns:
the current surface anchor value of self
- Return type:
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.
- present(width, height, layout)[source]¶
- Parameters:
width (
int
) – the unconstrained popup width to layoutheight (
int
) – the unconstrained popup height to layoutlayout (
Gdk.PopupLayout
) – theGdkPopupLayout
object used to layout
- Returns:
- Return type:
Present self 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`Gdk`.Surface::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 self is set to autohide and is immediately hidden upon being presented. If presenting failed, the [signal`Gdk`.Surface::layout] signal will not me emitted.
Property Details¶
- Gdk.Popup.props.autohide¶
- Name:
autohide
- Type:
- Default Value:
- Flags:
Whether to hide on outside clicks.
- Gdk.Popup.props.parent¶
- Name:
parent
- Type:
- Default Value:
- Flags:
The parent surface.