Collects the arguments that are needed to present a message to the user.
The message is shown with the [methodGtk.AlertDialog.choose] function.
If you don't need to wait for a button to be clicked, you can use [methodGtk.AlertDialog.show].
<group>Dialogs</group>
Buttons_Property : constant Glib.Properties.Property_String :=
Glib.Properties.Build ("buttons");
Unknown type: unspecified
Cancel_Button_Property : constant Glib.Properties.Property_Int;
Determines what happens when the <kbd>Escape</kbd> key is pressed while the alert is shown.
If this property holds the index of a button in [propertyGtk.AlertDialog: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 NULL, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.
procedure Choose
(Self : not null access Gtk_Alert_Dialog_Record;
Parent : access Gtk.Window.Gtk_Window_Record'Class;
Cancellable : access Glib.Cancellable.Gcancellable_Record'Class;
Callback : Gasync_Ready_Callback)
Shows the alert to the user. It is ok to pass NULL for the callback if the alert does not have more than one button. A simpler API for this case is [methodGtk.AlertDialog.show]. Since: gtk+ 4.10
the parent window
a cancellable to cancel the operation
a callback to call when the operation is complete
function Choose_Finish
(Self : not null access Gtk_Alert_Dialog_Record;
Result : Glib.G_Async_Result;
Error : out Glib.Error.GError) return Glib.Gint
Finishes the [methodGtk.AlertDialog.choose] call. Since: gtk+ 4.10
the result
the return location for a recoverable error
the index of the button that was clicked, or -1 if the dialog was cancelled and [propertyGtk.AlertDialog:cancel-button] is not set
Default_Button_Property : constant Glib.Properties.Property_Int;
Determines what happens when the <kbd>Return</kbd> key is pressed while the alert is shown.
If this property holds the index of a button in [propertyGtk.AlertDialog: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 NULL, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.
Detail_Property : constant Glib.Properties.Property_String;
The detail text for the alert.
type Gasync_Ready_Callback is access procedure
(Source_Object : access Glib.Object.GObject_Record'Class;
Res : Glib.G_Async_Result);
Type definition for a function that will be called back when an asynchronous operation within GIO has been completed. Gasync_Ready_Callback callbacks from Gtask.Gtask are guaranteed to be invoked in a later iteration of the thread-default main context (see [methodGlib.MainContext.push_thread_default]) where the Gtask.Gtask was created. All other users of Gasync_Ready_Callback must likewise call it asynchronously in a later iteration of the main context. The asynchronous operation is guaranteed to have held a reference to Source_Object from the time when the *_async function was called, until after this callback returns.
the object the asynchronous operation was started with.
a Glib.G_Async_Result.
function Get_Buttons
(Self : not null access Gtk_Alert_Dialog_Record)
return GNAT.Strings.String_List
Returns the button labels for the alert. Since: gtk+ 4.10
the button labels
function Get_Cancel_Button
(Self : not null access Gtk_Alert_Dialog_Record) return Glib.Gint
Returns the index of the cancel button. Since: gtk+ 4.10
the index of the cancel button, or -1
function Get_Default_Button
(Self : not null access Gtk_Alert_Dialog_Record) return Glib.Gint
Returns the index of the default button. Since: gtk+ 4.10
the index of the default button, or -1
function Get_Detail
(Self : not null access Gtk_Alert_Dialog_Record) return UTF8_String
Returns the detail text that will be shown in the alert. Since: gtk+ 4.10
the detail text
function Get_Message
(Self : not null access Gtk_Alert_Dialog_Record) return UTF8_String
Returns the message that will be shown in the alert. Since: gtk+ 4.10
the message
function Get_Modal
(Self : not null access Gtk_Alert_Dialog_Record) return Boolean
Returns whether the alert blocks interaction with the parent window while it is presented. Since: gtk+ 4.10
true if the alert is modal
function Get_Type return Glib.GType
type Gtk_Alert_Dialog is access all Gtk_Alert_Dialog_Record'Class;
function Gtk_Alert_Dialog_New
(Message : UTF8_String := "") return Gtk_Alert_Dialog
Creates a new alert dialog with the given message.
type Gtk_Alert_Dialog_Record is new GObject_Record with null record;
procedure Gtk_New
(Self : out Gtk_Alert_Dialog;
Message : UTF8_String := "")
Creates a new alert dialog. The Message text can be left empty and later set with Set_Message.
procedure Initialize
(Self : not null access Gtk_Alert_Dialog_Record'Class;
Message : UTF8_String := "")
Creates a new alert dialog. The Message text can be left empty and later set with Set_Message.
Message_Property : constant Glib.Properties.Property_String;
The message for the alert.
Modal_Property : constant Glib.Properties.Property_Boolean;
Whether the alert is modal.
procedure Set_Buttons
(Self : not null access Gtk_Alert_Dialog_Record;
Labels : GNAT.Strings.String_List)
Sets the button labels for the alert. Since: gtk+ 4.10
the new button labels
procedure Set_Cancel_Button
(Self : not null access Gtk_Alert_Dialog_Record;
Button : Glib.Gint)
Sets the index of the cancel button. See [propertyGtk.AlertDialog:cancel-button] for details of how this value is used. Since: gtk+ 4.10
the new cancel button
procedure Set_Default_Button
(Self : not null access Gtk_Alert_Dialog_Record;
Button : Glib.Gint)
Sets the index of the default button. See [propertyGtk.AlertDialog:default-button] for details of how this value is used. Since: gtk+ 4.10
the new default button
procedure Set_Detail
(Self : not null access Gtk_Alert_Dialog_Record;
Detail : UTF8_String)
Sets the detail text that will be shown in the alert. Since: gtk+ 4.10
the new detail text
procedure Set_Message
(Self : not null access Gtk_Alert_Dialog_Record;
Message : UTF8_String)
Sets the message that will be shown in the alert. Since: gtk+ 4.10
the new message
procedure Set_Modal
(Self : not null access Gtk_Alert_Dialog_Record;
Modal : Boolean)
Sets whether the alert blocks interaction with the parent window while it is presented. Since: gtk+ 4.10
the new value
procedure Show
(Self : not null access Gtk_Alert_Dialog_Record;
Parent : access Gtk.Window.Gtk_Window_Record'Class)
Shows the alert to the user. This function is a simpler version of [methodGtk.AlertDialog.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 [classGio.Cancellable] and callback respectively. Since: gtk+ 4.10
the parent window