AlertDialog
Object Hierarchy:
Description:
[
CCode ( type_id =
"gtk_alert_dialog_get_type ()" ) ]
[
Version ( since =
"4.10" ) ]
public sealed class AlertDialog :
Object
Collects the arguments that are needed to present a message to the user.
The message is shown with the [method@Gtk.AlertDialog.choose] function.
If you don't need to wait for a button to be clicked, you can use [method@Gtk.AlertDialog.show].
Content:
Properties:
- public string[] buttons { get; set; }
Labels for buttons to show in the alert.
- public int cancel_button { get; set; }
Determines what happens when the <kbd>Escape</kbd> key is
pressed while the alert is shown.
- public int default_button { get; set; }
Determines what happens when the <kbd>Return</kbd> key is
pressed while the alert is shown.
- public string detail { get; set; }
The detail text for the alert.
- public string message { get; set; }
The message for the alert.
- public bool modal { get; set; }
Whether the alert is modal.
Creation methods:
Methods:
- public async int choose (Window? parent, Cancellable? cancellable) throws Error
Shows the alert to the user.
- public unowned string[]? get_buttons ()
Returns the button labels for the alert.
- public int get_cancel_button ()
Returns the index of the cancel button.
- public int get_default_button ()
Returns the index of the default button.
- public unowned string get_detail ()
Returns the detail text that will be shown in the alert.
- public unowned string get_message ()
Returns the message that will be shown in the alert.
- public bool get_modal ()
Returns whether the alert blocks interaction with the parent window while it
is presented.
- public void set_buttons (string[] labels)
Sets the button labels for the alert.
- public void set_cancel_button (int button)
Sets the index of the cancel button.
- public void set_default_button (int button)
Sets the index of the default button.
- public void set_detail (string detail)
Sets the detail text that will be shown in the alert.
- public void set_message (string message)
Sets the message that will be shown in the alert.
- public void set_modal (bool modal)
Sets whether the alert blocks interaction with the parent window while it is
presented.
- public void show (Window? parent)
Shows the alert to the user.
Inherited Members:
All known members inherited from class GLib.Object