Documentation
¶
Overview ¶
The default use of AcceptDialog is to allow it to only be accepted or closed, with the same result. However, the OnConfirmed and OnCanceled signals allow to make the two actions different, and the AddButton method allows to add custom buttons and actions.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AddButton(text string) Button.Instance
- func (self Instance) AddCancelButton(name string) Button.Instance
- func (self Instance) AsAcceptDialog() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsViewport() Viewport.Instance
- func (self Instance) AsWindow() Window.Instance
- func (self Instance) DialogAutowrap() bool
- func (self Instance) DialogCloseOnEscape() bool
- func (self Instance) DialogHideOnOk() bool
- func (self Instance) DialogText() string
- func (self Instance) GetLabel() Label.Instance
- func (self Instance) GetOkButton() Button.Instance
- func (self Instance) ID() ID
- func (self Instance) MoreArgs() MoreArgs
- func (self Instance) OkButtonText() string
- func (self Instance) OnCanceled(cb func(), flags ...Signal.Flags)
- func (self Instance) OnConfirmed(cb func(), flags ...Signal.Flags)
- func (self Instance) OnCustomAction(cb func(action string), flags ...Signal.Flags)
- func (self Instance) RegisterTextEnter(line_edit LineEdit.Instance)
- func (self Instance) RemoveButton(button Button.Instance)
- func (self Instance) SetDialogAutowrap(value bool)
- func (self Instance) SetDialogCloseOnEscape(value bool)
- func (self Instance) SetDialogHideOnOk(value bool)
- func (self Instance) SetDialogText(value string)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOkButtonText(value string)
- func (self Instance) Virtual(name string) reflect.Value
- type MoreArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsAcceptDialog ¶
func (*Extension[T]) AsViewport ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.AcceptDialog
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddButton ¶
Adds a button with label 'text' and a custom 'action' to the dialog and returns the created button.
If 'action' is not empty, pressing the button will emit the OnCustomAction signal with the specified action string.
If true, 'right' will place the button to the right of any sibling buttons.
You can use RemoveButton method to remove a button created with this method from the dialog.
func (Instance) AddCancelButton ¶
Adds a button with label 'name' and a cancel action to the dialog and returns the created button.
You can use RemoveButton method to remove a button created with this method from the dialog.
func (Instance) AsAcceptDialog ¶
func (Instance) AsViewport ¶
func (Instance) DialogAutowrap ¶
func (Instance) DialogCloseOnEscape ¶
func (Instance) DialogHideOnOk ¶
func (Instance) DialogText ¶
func (Instance) GetLabel ¶
Returns the label used for built-in text.
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.
func (Instance) GetOkButton ¶
Returns the OK Button instance.
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.
func (Instance) MoreArgs ¶
MoreArgs enables certain functions to be called with additional 'optional' arguments.
func (Instance) OkButtonText ¶
func (Instance) OnCanceled ¶
func (Instance) OnConfirmed ¶
func (Instance) OnCustomAction ¶
func (Instance) RegisterTextEnter ¶
Registers a LineEdit in the dialog. When the enter key is pressed, the dialog will be accepted.
func (Instance) RemoveButton ¶
Removes the 'button' from the dialog. Does NOT free the 'button'. The 'button' must be a Button added with AddButton or AddCancelButton method. After removal, pressing the 'button' will no longer emit this dialog's OnCustomAction or OnCanceled signals.
func (Instance) SetDialogAutowrap ¶
func (Instance) SetDialogCloseOnEscape ¶
func (Instance) SetDialogHideOnOk ¶
func (Instance) SetDialogText ¶
func (Instance) SetOkButtonText ¶
type MoreArgs ¶
type MoreArgs [1]gdclass.AcceptDialog
MoreArgs is a container for Instance functions with additional 'optional' arguments.
func (MoreArgs) AddButton ¶
Adds a button with label 'text' and a custom 'action' to the dialog and returns the created button.
If 'action' is not empty, pressing the button will emit the OnCustomAction signal with the specified action string.
If true, 'right' will place the button to the right of any sibling buttons.
You can use RemoveButton method to remove a button created with this method from the dialog.