Class: Gtk::AlertDialog
- Inherits:
-
Object
- Object
- Gtk::AlertDialog
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#buttons ⇒ Gtk::
Labels for buttons to show in the alert.
-
#buttons=(buttons) ⇒ Gtk::
Labels for buttons to show in the alert.
-
#cancel_button ⇒ Integer
This property determines what happens when the Escape key is pressed while the alert is shown.
-
#cancel_button=(cancel_button) ⇒ Integer
This property determines what happens when the Escape key is pressed while the alert is shown.
-
#choose(parent, cancellable, callback, user_data) ⇒ nil
This function shows the alert to the user.
-
#choose_finish(result) ⇒ Integer
Finishes the [methodGtk.AlertDialog.choose] call and returns the index of the button that was clicked.
-
#default_button ⇒ Integer
This property determines what happens when the Return key is pressed while the alert is shown.
-
#default_button=(default_button) ⇒ Integer
This property determines what happens when the Return key is pressed while the alert is shown.
-
#detail ⇒ String
The detail text for the alert.
-
#detail=(detail) ⇒ String
The detail text for the alert.
-
#initialize(format, array) ⇒ Gtk::AlertDialog
constructor
Creates a new
GtkAlertDialogobject. -
#message ⇒ String
The message for the alert.
-
#message=(message) ⇒ String
The message for the alert.
-
#modal ⇒ Boolean
Returns whether the alert blocks interaction with the parent window while it is presented.
-
#modal=(modal) ⇒ Boolean
Whether the alert is modal.
-
#modal? ⇒ Boolean
Whether the alert is modal.
-
#show(parent) ⇒ nil
Show the alert to the user.
Constructor Details
#initialize(format, array) ⇒ Gtk::AlertDialog
Creates a new GtkAlertDialog object.
The message will be set to the formatted string resulting from the arguments.
Instance Method Details
#buttons ⇒ Gtk::
Labels for buttons to show in the alert.
The labels should be translated and may contain a _ to indicate the mnemonic character.
If this property is not set, then a 'Close' button is automatically created.
#buttons=(buttons) ⇒ Gtk::
Labels for buttons to show in the alert.
The labels should be translated and may contain a _ to indicate the mnemonic character.
If this property is not set, then a 'Close' button is automatically created.
#cancel_button ⇒ Integer
This property determines what happens when the Escape 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.
#cancel_button=(cancel_button) ⇒ Integer
This property determines what happens when the Escape 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.
#choose(parent, cancellable, callback, user_data) ⇒ nil
This function shows the alert to the user.
The callback will be called when the alert is dismissed. It should call [methodGtk.AlertDialog.choose_finish] to obtain the result.
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].
#choose_finish(result) ⇒ Integer
Finishes the [methodGtk.AlertDialog.choose] call and returns the index of the button that was clicked.
#default_button ⇒ Integer
This property determines what happens when the Return 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.
#default_button=(default_button) ⇒ Integer
This property determines what happens when the Return 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 ⇒ String
The detail text for the alert.
#detail=(detail) ⇒ String
The detail text for the alert.
#message ⇒ String
The message for the alert.
#message=(message) ⇒ String
The message for the alert.
#modal ⇒ Boolean
Returns whether the alert blocks interaction with the parent window while it is presented.
#modal=(modal) ⇒ Boolean
Whether the alert is modal.
#modal? ⇒ Boolean
Whether the alert is modal.
#show(parent) ⇒ nil
Show the alert to the user.
This function is a simple 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 #GCancellable or callback respectively.