### Class

# Gtk AlertDialog

since: 4.10

#### Description [src]

    final class Gtk.AlertDialog : GObject.Object
    {
      /* No available fields */
    }

A `GtkAlertDialog` object collects the arguments that are needed to present a message to the user.

The message is shown with the `gtk_alert_dialog_choose()` function. This API follows the GIO async pattern, and the result can be obtained by calling `gtk_alert_dialog_choose_finish()`.

If you don’t need to wait for a button to be clicked, you can use `gtk_alert_dialog_show()`.

Available since: 4.10

#### Ancestors

- GObject

#### Constructors

###### gtk_alert_dialog_new

Creates a new `GtkAlertDialog` object.

since: 4.10

#### Instance methods

###### gtk_alert_dialog_choose

This function shows the alert to the user.

since: 4.10

###### gtk_alert_dialog_choose_finish

Finishes the `gtk_alert_dialog_choose()` call and returns the index of the button that was clicked.

since: 4.10

###### gtk_alert_dialog_get_buttons

Returns the button labels for the alert.

since: 4.10

###### gtk_alert_dialog_get_cancel_button

Returns the index of the cancel button.

since: 4.10

###### gtk_alert_dialog_get_default_button

Returns the index of the default button.

since: 4.10

###### gtk_alert_dialog_get_detail

Returns the detail text that will be shown in the alert.

since: 4.10

###### gtk_alert_dialog_get_message

Returns the message that will be shown in the alert.

since: 4.10

###### gtk_alert_dialog_get_modal

Returns whether the alert blocks interaction with the parent window while it is presented.

since: 4.10

###### gtk_alert_dialog_set_buttons

Sets the button labels for the alert.

since: 4.10

###### gtk_alert_dialog_set_cancel_button

Sets the index of the cancel button.

since: 4.10

###### gtk_alert_dialog_set_default_button

Sets the index of the default button.

since: 4.10

###### gtk_alert_dialog_set_detail

Sets the detail text that will be shown in the alert.

since: 4.10

###### gtk_alert_dialog_set_message

Sets the message that will be shown in the alert.

since: 4.10

###### gtk_alert_dialog_set_modal

Sets whether the alert blocks interaction with the parent window while it is presented.

since: 4.10

###### gtk_alert_dialog_show

Show the alert to the user.

since: 4.10

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gtk.AlertDialog:buttons

Labels for buttons to show in the alert.

since: 4.10

###### Gtk.AlertDialog:cancel-button

This property determines what happens when the Escape key is pressed while the alert is shown.

since: 4.10

###### Gtk.AlertDialog:default-button

This property determines what happens when the Return key is pressed while the alert is shown.

since: 4.10

###### Gtk.AlertDialog:detail

The detail text for the alert.

since: 4.10

###### Gtk.AlertDialog:message

The message for the alert.

since: 4.10

###### Gtk.AlertDialog:modal

Whether the alert is modal.

since: 4.10

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

since: 2.0

#### Class structure

    struct GtkAlertDialogClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`
  No description available.