AlertDialog

open class AlertDialog(pointer: <Error class: unknown class><<Error class: unknown class>>)

A GtkAlertDialog 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.

Skipped during bindings generation

  • method buttons: Property TypeInfo of getter and setter do not match

Since

4.10

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open var cancelButton: Int

This property determines what happens when the Escape key is pressed while the alert is shown.

Link copied to clipboard
open var defaultButton: Int

This property determines what happens when the Return key is pressed while the alert is shown.

Link copied to clipboard
open var detail: String

The detail text for the alert.

Link copied to clipboard
val gtkAlertDialogPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open var message: String

The message for the alert.

Link copied to clipboard
open var modal: Boolean

Whether the alert is modal.

Functions

Link copied to clipboard
open fun choose(parent: Window? = null, cancellable: <Error class: unknown class>? = null, callback: <Error class: unknown class>)

This function shows the alert to the user.

Link copied to clipboard
open fun chooseFinish(result: <Error class: unknown class>): <Error class: unknown class><Int>

Finishes the method@Gtk.AlertDialog.choose call and returns the index of the button that was clicked.

Link copied to clipboard
open fun getButtons(): List<String>?

Returns the button labels for the alert.

Link copied to clipboard
open fun getCancelButton(): Int

Returns the index of the cancel button.

Link copied to clipboard
open fun getDefaultButton(): Int

Returns the index of the default button.

Link copied to clipboard
open fun getDetail(): String

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

Link copied to clipboard
open fun getMessage(): String

Returns the message that will be shown in the alert.

Link copied to clipboard
open fun getModal(): Boolean

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

Link copied to clipboard
open fun setButtons(labels: List<String>)

Sets the button labels for the alert.

Link copied to clipboard
open fun setCancelButton(button: Int)

Sets the index of the cancel button.

Link copied to clipboard
open fun setDefaultButton(button: Int)

Sets the index of the default button.

Link copied to clipboard
open fun setDetail(detail: String)

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

Link copied to clipboard
open fun setMessage(message: String)

Sets the message that will be shown in the alert.

Link copied to clipboard
open fun setModal(modal: Boolean)

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

Link copied to clipboard
open fun show(parent: Window? = null)

Show the alert to the user.