Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

ConfirmationDialog

繼承: AcceptDialog < Window < Viewport < Node < Object

被繼承: EditorCommandPalette, FileDialog, ScriptCreateDialog

用於確認動作的對話方塊。

說明

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.

To get cancel action, you can use:

get_cancel_button().pressed.connect(_on_canceled)

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().

屬性

String

cancel_button_text

"Cancel"

Vector2i

min_size

Vector2i(200, 70) (overrides Window)

Vector2i

size

Vector2i(200, 100) (overrides Window)

String

title

"Please Confirm..." (overrides Window)

方法

Button

get_cancel_button()


屬性說明

String cancel_button_text = "Cancel" 🔗

  • void set_cancel_button_text(value: String)

  • String get_cancel_button_text()

取消按鈕顯示的文字(見 get_cancel_button())。


方法說明

Button get_cancel_button() 🔗

返回取消按鈕。

警告:這是一個必需的內部節點,移除並釋放它可能會導致當機。如果你希望隱藏它或其任何子項,請使用其 CanvasItem.visible 屬性。