Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: AlertDialog

[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].

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • AlertDialog (Handle = null)

    Creates a new AlertDialog by wrapping a native handle or another wrapper.

    • @p 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 exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r 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 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.

    • @p Value is the new property value.
    • @r 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 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.

    • @p Value is the new property value.
    • @r None.
  • setDetail (string Value)

    The detail text for the alert.

    • @p Value is the new property value.
    • @r None.
  • setMessage (string Value)

    The message for the alert.

    • @p Value is the new property value.
    • @r None.
  • setModal (bool Value)

    Whether the alert is modal.

    • @p Value is the new property value.
    • @r None.
  • choose_finish (object result)

    Finishes the [method@Gtk.AlertDialog.choose] call.

    • @p 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.

    • @p labels is the new button labels.
    • @r 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.

    • @p button is the new cancel button.
    • @r 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.

    • @p button is the new default button.
    • @r None.
  • set_detail (string detail)

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

    • @p detail is the new detail text.
    • @r None.
  • set_message (string message)

    Sets the message that will be shown in the alert.

    • @p message is the new message.
    • @r None.
  • set_modal (bool modal)

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

    • @p modal is the new value.
    • @r 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.

    • @p parent is the parent window.
    • @r None.

class: AlertDialogMeta

[348:14] static extends: object

Generated metadata helpers for AlertDialog class surfaces.

Methods

  • properties ()

    Returns property metadata for AlertDialog.

    • @r A list.