ConfirmationDialog
Inherits: AcceptDialog < Window < Viewport < Entity < Object
Inherited by: EditorCommandPalette, FileDialog, ScriptCreateDialog
Description
Section titled “Description”A dialog used for confirmation of actions.
A dialog used for confirmation of actions. This window is similar to AcceptDialog, but pressing its Cancel button can have a different outcome from pressing the OK button. The order of the two buttons varies depending on the host OS.
Note: The dialog controls the size of its buttons, any manual size changes will be overridden. Use the AcceptDialog.buttons_min_width and AcceptDialog.buttons_min_height theme constants instead.
To get cancel action, you can use:
GetCancelButton().Pressed += OnCanceled;Note: AcceptDialog is invisible by default. To make it visible, call one of the popup_* methods from Window on the node, such as Window.popup_centered_clamped().
Properties
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| String | cancel_button_text |
"Cancel" |
| Vector2i | min_size |
Vector2i(200, 70) (overrides Window) |
| Vector2i | size |
Vector2i(200, 100) (overrides Window) |
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| Button | get_cancel_button() |
Property descriptions
Section titled “Property descriptions”cancel_button_text
String cancel_button_text = "Cancel"
The text displayed by the cancel button (see get_cancel_button()).
Method descriptions
Section titled “Method descriptions”get_cancel_button
Button get_cancel_button()
Returns the cancel button.
Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their CanvasItem.visible property.
