Basics
Guides
API Reference
Basics
Guides
API Reference
[15:7] extends: 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].
AlertDialog (Handle = null)
Creates a new
AlertDialogby wrapping a native handle or another wrapper.
Handle is the native handle or another wrapper whose handle to adopt.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setCancelbutton (int Value)
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@Gtk.AlertDialog:buttons], then pressing Escape is treated as if that button was pressed. If it is -1 or not a valid index for the
buttonsarray, then an error is returned. IfbuttonsisNULL, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.
Value is the new property value.None.setDefaultbutton (int Value)
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@Gtk.AlertDialog:buttons], then pressing Return is treated as if that button was pressed. If it is -1 or not a valid index for the
buttonsarray, then nothing happens. IfbuttonsisNULL, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.
Value is the new property value.None.setDetail (string Value)
The detail text for the alert.
Value is the new property value.None.setMessage (string Value)
The message for the alert.
Value is the new property value.None.setModal (bool Value)
Whether the alert is modal.
Value is the new property value.None.choose_finish (object result)
Finishes the [method@Gtk.AlertDialog.choose] call.
result is the result.get_buttons ()
Returns the button labels for the alert.
get_cancel_button ()
Returns the index of the cancel button.
get_default_button ()
Returns the index of the default button.
get_detail ()
Returns the detail text that will be shown in the alert.
get_message ()
Returns the message that will be shown in the alert.
get_modal ()
Returns whether the alert blocks interaction with the parent window while it is presented.
set_buttons (list labels)
Sets the button labels for the alert.
labels is the new button labels.None.set_cancel_button (int button)
Sets the index of the cancel button. See [property@Gtk.AlertDialog:cancel-button] for details of how this value is used.
button is the new cancel button.None.set_default_button (int button)
Sets the index of the default button. See [property@Gtk.AlertDialog:default-button] for details of how this value is used.
button is the new default button.None.set_detail (string detail)
Sets the detail text that will be shown in the alert.
detail is the new detail text.None.set_message (string message)
Sets the message that will be shown in the alert.
message is the new message.None.set_modal (bool modal)
Sets whether the alert blocks interaction with the parent window while it is presented.
modal is the new value.None.show (object parent)
Shows the alert to the user. This function is a simpler version of [method@Gtk.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 [class@Gio.Cancellable] and callback respectively.
parent is the parent window.None.[348:14] static extends: object
Generated metadata helpers for AlertDialog class surfaces.
properties ()
Returns property metadata for
AlertDialog.
A list.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.