gtk.alert_dialog

Module for [AlertDialog] class

Types 3

A [gtk.alert_dialog.AlertDialog] object collects the arguments that are needed to present a message to the user.

The message is shown with the [gtk.alert_dialog.AlertDialog.choose] function. This API follows the GIO async pattern, and the result can be obtained by calling [gtk.alert_dialog.AlertDialog.chooseFinish].

If you don't need to wait for a button to be clicked, you can use [gtk.alert_dialog.AlertDialog.show].

Methods
GType _gType() @property
AlertDialog self()Returns `this`, for use in `with` statements.
AlertDialogGidBuilder builder()Get builder for [gtk.alert_dialog.AlertDialog] Returns: New builder object
int cancelButton() @propertyGet `cancelButton` property. Returns: This property determines what happens when the Escape key is pressed while the alert is shown.
void cancelButton(int propval) @propertySet `cancelButton` property. Params: propval = This property determines what happens when the Escape key is pressed while the alert is shown.
int defaultButton() @propertyGet `defaultButton` property. Returns: This property determines what happens when the Return key is pressed while the alert is shown.
void defaultButton(int propval) @propertySet `defaultButton` property. Params: propval = This property determines what happens when the Return key is pressed while the alert is shown.
string detail() @propertyGet `detail` property. Returns: The detail text for the alert.
void detail(string propval) @propertySet `detail` property. Params: propval = The detail text for the alert.
string message() @propertyGet `message` property. Returns: The message for the alert.
void message(string propval) @propertySet `message` property. Params: propval = The message for the alert.
bool modal() @propertyGet `modal` property. Returns: Whether the alert is modal.
void modal(bool propval) @propertySet `modal` property. Params: propval = Whether the alert is modal.
void choose(gtk.window.Window parent = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)This function shows the alert to the user.
int chooseFinish(gio.async_result.AsyncResult result)Finishes the [gtk.alert_dialog.AlertDialog.choose] call and returns the index of the button that was clicked.
string[] getButtons()Returns the button labels for the alert. Returns: the button labels
int getCancelButton()Returns the index of the cancel button. Returns: the index of the cancel button, or -1
int getDefaultButton()Returns the index of the default button. Returns: the index of the default button, or -1
string getDetail()Returns the detail text that will be shown in the alert. Returns: the detail text
string getMessage()Returns the message that will be shown in the alert. Returns: the message
bool getModal()Returns whether the alert blocks interaction with the parent window while it is presented. Returns: `TRUE` if the alert is modal
void setButtons(string[] labels)Sets the button labels for the alert.
void setCancelButton(int button)Sets the index of the cancel button.
void setDefaultButton(int button)Sets the index of the default button.
void setDetail(string detail)Sets the detail text that will be shown in the alert.
void setMessage(string message)Sets the message that will be shown in the alert.
void setModal(bool modal)Sets whether the alert blocks interaction with the parent window while it is presented.
void show(gtk.window.Window parent = null)Show the alert to the user.
Constructors
this(void * ptr, Flag!"Take" take)
Methods
T cancelButton(int propval)Set `cancelButton` property. Params: propval = This property determines what happens when the Escape key is pressed while the alert is shown.
T defaultButton(int propval)Set `defaultButton` property. Params: propval = This property determines what happens when the Return key is pressed while the alert is shown.
T detail(string propval)Set `detail` property. Params: propval = The detail text for the alert. Returns: Builder instance for fluent chaining
T message(string propval)Set `message` property. Params: propval = The message for the alert. Returns: Builder instance for fluent chaining
T modal(bool propval)Set `modal` property. Params: propval = Whether the alert is modal. Returns: Builder instance for fluent chaining

Fluent builder for [gtk.alert_dialog.AlertDialog]