|
gtkmm 4.15.1
|
A Gtk::AlertDialog object collects the arguments that are needed to present a message to the user. More...
#include <gtkmm/alertdialog.h>

Public Member Functions | |
| AlertDialog (AlertDialog &&src) noexcept | |
| AlertDialog & | operator= (AlertDialog &&src) noexcept |
| ~AlertDialog () noexcept override | |
| GtkAlertDialog * | gobj () |
| Provides access to the underlying C GObject. | |
| const GtkAlertDialog * | gobj () const |
| Provides access to the underlying C GObject. | |
| GtkAlertDialog * | gobj_copy () |
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
| bool | get_modal () const |
| Returns whether the alert blocks interaction with the parent window while it is presented. | |
| void | set_modal (bool modal=true) |
| Sets whether the alert blocks interaction with the parent window while it is presented. | |
| Glib::ustring | get_message () const |
| Returns the message that will be shown in the alert. | |
| void | set_message (const Glib::ustring & message) |
| Sets the message that will be shown in the alert. | |
| Glib::ustring | get_detail () const |
| Returns the detail text that will be shown in the alert. | |
| void | set_detail (const Glib::ustring & detail) |
| Sets the detail text that will be shown in the alert. | |
| std::vector< Glib::ustring > | get_buttons () const |
| Returns the button labels for the alert. | |
| void | set_buttons (const std::vector< Glib::ustring > &labels) const |
| Sets the button labels for the alert. | |
| int | get_cancel_button () const |
| Returns the index of the cancel button. | |
| void | set_cancel_button (int button) |
| Sets the index of the cancel button. | |
| int | get_default_button () const |
| Returns the index of the default button. | |
| void | set_default_button (int button) |
| Sets the index of the default button. | |
| void | choose (Window & parent, const Gio::SlotAsyncReady & slot, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) const |
| This function shows the alert to the user. | |
| void | choose (const Gio::SlotAsyncReady & slot, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) const |
| A choose() convenience overload. | |
| int | choose_finish (const Glib::RefPtr< Gio::AsyncResult > &result) const |
| Finishes the choose() call and returns the index of the button that was clicked. | |
| void | show (Window & parent) |
| Show the alert to the user. | |
| void | show () |
| A show() convenience overload. | |
| Glib::PropertyProxy< bool > | property_modal () |
| Whether the alert is modal. | |
| Glib::PropertyProxy_ReadOnly< bool > | property_modal () const |
| Whether the alert is modal. | |
| Glib::PropertyProxy< Glib::ustring > | property_message () |
| The message for the alert. | |
| Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_message () const |
| The message for the alert. | |
| Glib::PropertyProxy< Glib::ustring > | property_detail () |
| The detail text for the alert. | |
| Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_detail () const |
| The detail text for the alert. | |
| Glib::PropertyProxy< std::vector< Glib::ustring > > | property_buttons () |
| Labels for buttons to show in the alert. | |
| Glib::PropertyProxy_ReadOnly< std::vector< Glib::ustring > > | property_buttons () const |
| Labels for buttons to show in the alert. | |
| Glib::PropertyProxy< int > | property_cancel_button () |
| This property determines what happens when the Escape key is pressed while the alert is shown. | |
| Glib::PropertyProxy_ReadOnly< int > | property_cancel_button () const |
| This property determines what happens when the Escape key is pressed while the alert is shown. | |
| Glib::PropertyProxy< int > | property_default_button () |
| This property determines what happens when the Return key is pressed while the alert is shown. | |
| Glib::PropertyProxy_ReadOnly< int > | property_default_button () const |
| This property determines what happens when the Return key is pressed while the alert is shown. | |
Public Member Functions inherited from Glib::Object | |
| Object (const Object &)=delete | |
| Object & | operator= (const Object &)=delete |
| Object (Object &&src) noexcept | |
| Object & | operator= (Object &&src) noexcept |
| void * | get_data (const QueryQuark &key) |
| void | set_data (const Quark &key, void *data) |
| void | set_data_with_c_callback (const Quark &key, void *data, GDestroyNotify notify) |
| void | set_data (const Quark &key, void *data, DestroyNotify notify) |
| void | remove_data (const QueryQuark &quark) |
| void * | steal_data (const QueryQuark &quark) |
| Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
Public Member Functions inherited from Glib::ObjectBase | |
| ObjectBase (const ObjectBase &)=delete | |
| ObjectBase & | operator= (const ObjectBase &)=delete |
| void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
| void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
| void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
| void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
| PropertyType | get_property (const Glib::ustring &property_name) const |
| sigc::connection | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot) |
| sigc::connection | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot) |
| void | freeze_notify () |
| void | thaw_notify () |
| virtual void | reference () const |
| virtual void | unreference () const |
| GObject * | gobj () |
| const GObject * | gobj () const |
| GObject * | gobj_copy () const |
Public Member Functions inherited from sigc::trackable | |
| trackable () noexcept | |
| trackable (const trackable &src) noexcept | |
| trackable (trackable &&src) noexcept | |
| ~trackable () | |
| void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const |
| void | notify_callbacks () |
| trackable & | operator= (const trackable &src) |
| trackable & | operator= (trackable &&src) noexcept |
| void | remove_destroy_notify_callback (notifiable *data) const |
Static Public Member Functions | |
| static GType | get_type () |
| Get the GType for this class, for use with the underlying GObject type system. | |
| static Glib::RefPtr< AlertDialog > | create () |
| static Glib::RefPtr< AlertDialog > | create (const Glib::ustring & message) |
| Creates a new Gtk::AlertDialog with the given message. | |
Protected Member Functions | |
| AlertDialog () | |
| AlertDialog (const Glib::ustring & message) | |
| Creates a new Gtk::AlertDialog with the given message. | |
Protected Member Functions inherited from Glib::Object | |
| Object () | |
| Object (const Glib::ConstructParams &construct_params) | |
| Object (GObject *castitem) | |
| ~Object () noexcept override | |
Protected Member Functions inherited from Glib::ObjectBase | |
| ObjectBase () | |
| ObjectBase (const char *custom_type_name) | |
| ObjectBase (const std::type_info &custom_type_info) | |
| ObjectBase (ObjectBase &&src) noexcept | |
| ObjectBase & | operator= (ObjectBase &&src) noexcept |
| virtual | ~ObjectBase () noexcept=0 |
| void | initialize (GObject *castitem) |
| void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Symbols | |
(Note that these are not member symbols.) | |
| Glib::RefPtr< Gtk::AlertDialog > | wrap (GtkAlertDialog *object, bool take_copy=false) |
| A Glib::wrap() method for this object. | |
Additional Inherited Members | |
Public Types inherited from Glib::Object | |
| typedef void(*)(gpointer data | DestroyNotify) |
Public Types inherited from sigc::trackable | |
| typedef internal::func_destroy_notify | func_destroy_notify |
Public Types inherited from sigc::notifiable | |
| typedef internal::func_destroy_notify | func_destroy_notify |
A Gtk::AlertDialog object collects the arguments that are needed to present a message to the user.
The message is shown with the choose() method. This API follows the GIO async pattern, and the result can be obtained by calling choose_finish().
If you don't need to wait for a button to be clicked, you can use show().
|
noexcept |
|
overridenoexcept |
|
protected |
|
explicitprotected |
Creates a new Gtk::AlertDialog with the given message.
| message | The message. |
| void Gtk::AlertDialog::choose | ( | const Gio::SlotAsyncReady & | slot, |
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) | const |
A choose() convenience overload.
| void Gtk::AlertDialog::choose | ( | Window & | parent, |
| const Gio::SlotAsyncReady & | slot, | ||
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) | const |
This function shows the alert to the user.
It is ok to pass nullptr for the callback if the alert does not have more than one button. A simpler API for this case is show().
| parent | The parent Gtk::Window. |
| cancellable | A Cancellable to cancel the operation. |
| slot | A callback to call when the operation is complete. |
| int Gtk::AlertDialog::choose_finish | ( | const Glib::RefPtr< Gio::AsyncResult > & | result | ) | const |
Finishes the choose() call and returns the index of the button that was clicked.
| result | A Gio::AsyncResult. |
| Gtk::DialogError |
|
static |
|
static |
Creates a new Gtk::AlertDialog with the given message.
| message | The message. |
| std::vector< Glib::ustring > Gtk::AlertDialog::get_buttons | ( | ) | const |
| int Gtk::AlertDialog::get_cancel_button | ( | ) | const |
Returns the index of the cancel button.
| int Gtk::AlertDialog::get_default_button | ( | ) | const |
Returns the index of the default button.
| Glib::ustring Gtk::AlertDialog::get_detail | ( | ) | const |
| Glib::ustring Gtk::AlertDialog::get_message | ( | ) | const |
| bool Gtk::AlertDialog::get_modal | ( | ) | const |
Returns whether the alert blocks interaction with the parent window while it is presented.
true if the alert is modal.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
| GtkAlertDialog * Gtk::AlertDialog::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
noexcept |
| Glib::PropertyProxy< std::vector< Glib::ustring > > Gtk::AlertDialog::property_buttons | ( | ) |
Labels for buttons to show in the alert.
The labels should be translated and may contain a _ to indicate the mnemonic character.
If this property is not set, then a 'Close' button is automatically created.
| Glib::PropertyProxy_ReadOnly< std::vector< Glib::ustring > > Gtk::AlertDialog::property_buttons | ( | ) | const |
Labels for buttons to show in the alert.
The labels should be translated and may contain a _ to indicate the mnemonic character.
If this property is not set, then a 'Close' button is automatically created.
| Glib::PropertyProxy< int > Gtk::AlertDialog::property_cancel_button | ( | ) |
This property determines what happens when the Escape key is pressed while the alert is shown.
If this property holds the index of a button in property_buttons(), then pressing Escape is treated as if that button was pressed. If it is -1 or not a valid index for the buttons array, then an error is returned.
If buttons is nullptr, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.
Default value: -1
| Glib::PropertyProxy_ReadOnly< int > Gtk::AlertDialog::property_cancel_button | ( | ) | const |
This property determines what happens when the Escape key is pressed while the alert is shown.
If this property holds the index of a button in property_buttons(), then pressing Escape is treated as if that button was pressed. If it is -1 or not a valid index for the buttons array, then an error is returned.
If buttons is nullptr, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.
Default value: -1
| Glib::PropertyProxy< int > Gtk::AlertDialog::property_default_button | ( | ) |
This property determines what happens when the Return key is pressed while the alert is shown.
If this property holds the index of a button in property_buttons(), then pressing Return is treated as if that button was pressed. If it is -1 or not a valid index for the buttons array, then nothing happens.
If buttons is nullptr, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.
Default value: -1
| Glib::PropertyProxy_ReadOnly< int > Gtk::AlertDialog::property_default_button | ( | ) | const |
This property determines what happens when the Return key is pressed while the alert is shown.
If this property holds the index of a button in property_buttons(), then pressing Return is treated as if that button was pressed. If it is -1 or not a valid index for the buttons array, then nothing happens.
If buttons is nullptr, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.
Default value: -1
| Glib::PropertyProxy< Glib::ustring > Gtk::AlertDialog::property_detail | ( | ) |
The detail text for the alert.
Default value: ""
| Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::AlertDialog::property_detail | ( | ) | const |
The detail text for the alert.
Default value: ""
| Glib::PropertyProxy< Glib::ustring > Gtk::AlertDialog::property_message | ( | ) |
The message for the alert.
Default value: ""
| Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::AlertDialog::property_message | ( | ) | const |
The message for the alert.
Default value: ""
| Glib::PropertyProxy< bool > Gtk::AlertDialog::property_modal | ( | ) |
Whether the alert is modal.
Default value: true
| Glib::PropertyProxy_ReadOnly< bool > Gtk::AlertDialog::property_modal | ( | ) | const |
Whether the alert is modal.
Default value: true
| void Gtk::AlertDialog::set_buttons | ( | const std::vector< Glib::ustring > & | labels | ) | const |
| void Gtk::AlertDialog::set_cancel_button | ( | int | button | ) |
Sets the index of the cancel button.
See property_cancel_button() for details of how this value is used.
| button | The new cancel button. |
| void Gtk::AlertDialog::set_default_button | ( | int | button | ) |
Sets the index of the default button.
See property_default_button() for details of how this value is used.
| button | The new default button. |
| void Gtk::AlertDialog::set_detail | ( | const Glib::ustring & | detail | ) |
Sets the detail text that will be shown in the alert.
| detail | The new detail text. |
| void Gtk::AlertDialog::set_message | ( | const Glib::ustring & | message | ) |
Sets the message that will be shown in the alert.
| message | The new message. |
Sets whether the alert blocks interaction with the parent window while it is presented.
| modal | The new value. |
Show the alert to the user.
This function is a simple version of choose() intended for dialogs with a single button. If you want to cancel the dialog or if the alert has more than one button, you should use that function instead and provide it with a Cancellable or callback respectively.
| parent | The parent Gtk::Window. |
|
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. |