gtkmm 4.16.0
|
Interface for popup surfaces. More...
#include <gdkmm/popup.h>
Public Member Functions | |
Popup (Popup &&src) noexcept | |
Popup & | operator= (Popup &&src) noexcept |
~Popup () noexcept override | |
GdkPopup * | gobj () |
Provides access to the underlying C GObject. | |
const GdkPopup * | gobj () const |
Provides access to the underlying C GObject. | |
bool | present (int width, int height, const Glib::RefPtr< PopupLayout > &layout) |
Present popup after having processed the Gdk::PopupLayout rules. | |
Gravity | get_surface_anchor () const |
Gets the current popup surface anchor. | |
Gravity | get_rect_anchor () const |
Gets the current popup rectangle anchor. | |
Glib::RefPtr< Surface > | get_parent () |
Returns the parent surface of a popup. | |
Glib::RefPtr< const Surface > | get_parent () const |
Returns the parent surface of a popup. | |
int | get_position_x () const |
Obtains the position of the popup relative to its parent. | |
int | get_position_y () const |
Obtains the position of the popup relative to its parent. | |
bool | get_autohide () const |
Returns whether this popup is set to hide on outside clicks. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Surface > > | property_parent () const |
The parent surface. | |
Glib::PropertyProxy_ReadOnly< bool > | property_autohide () const |
Whether to hide on outside clicks. | |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Protected Member Functions | |
Popup () | |
You should derive from this class to use it. | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gdk::Popup > | wrap (GdkPopup *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Interface for popup surfaces.
A Gdk::Popup is a surface that is attached to another surface, called its property_parent(), and is positioned relative to it.
Gdk::Popups are typically used to implement menus and similar popups. They can be modal, which is indicated by the property_autohide() property.
|
protected |
You should derive from this class to use it.
|
noexcept |
|
overridenoexcept |
bool Gdk::Popup::get_autohide | ( | ) | const |
Returns whether this popup is set to hide on outside clicks.
true
if popup will autohide. Glib::RefPtr< Surface > Gdk::Popup::get_parent | ( | ) |
Returns the parent surface of a popup.
Returns the parent surface of a popup.
int Gdk::Popup::get_position_x | ( | ) | const |
Obtains the position of the popup relative to its parent.
int Gdk::Popup::get_position_y | ( | ) | const |
Obtains the position of the popup relative to its parent.
Gravity Gdk::Popup::get_rect_anchor | ( | ) | const |
Gets the current popup rectangle anchor.
The value returned may change after calling present(), or after the Gdk::Surface::signal_layout() signal is emitted.
Gravity Gdk::Popup::get_surface_anchor | ( | ) | const |
Gets the current popup surface anchor.
The value returned may change after calling present(), or after the Gdk::Surface::signal_layout() signal is emitted.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
bool Gdk::Popup::present | ( | int | width, |
int | height, | ||
const Glib::RefPtr< PopupLayout > & | layout | ||
) |
Present popup after having processed the Gdk::PopupLayout
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 Gdk::Surface::signal_layout() signal being emitted. The resulting popup position can be queried using get_position_x(), get_position_y(), and the resulting size will be sent as parameters in the layout signal. Use get_rect_anchor() and 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 Gdk::Surface::signal_layout() signal will not me emitted.
width | The unconstrained popup width to layout. |
height | The unconstrained popup height to layout. |
layout | The Gdk::PopupLayout object used to layout. |
false
if it failed to be presented, otherwise true
. Glib::PropertyProxy_ReadOnly< bool > Gdk::Popup::property_autohide | ( | ) | const |
Whether to hide on outside clicks.
Default value: false
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Surface > > Gdk::Popup::property_parent | ( | ) | const |
The parent surface.
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |