AcceptDialog

package
v0.0.0-...-fa94a0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 29 Imported by: 0

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

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 Any

type Any interface {
	gd.IsClass
	AsAcceptDialog() Instance
}

type Expanded

type Expanded = MoreArgs

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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 (self *Extension[T]) AsAcceptDialog() Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsViewport

func (self *Extension[T]) AsViewport() Viewport.Instance

func (*Extension[T]) AsWindow

func (self *Extension[T]) AsWindow() Window.Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

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 New

func New() Instance

func (Instance) AddButton

func (self Instance) AddButton(text string) Button.Instance

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

func (self Instance) AddCancelButton(name string) Button.Instance

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 (self Instance) AsAcceptDialog() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsViewport

func (self Instance) AsViewport() Viewport.Instance

func (Instance) AsWindow

func (self Instance) AsWindow() Window.Instance

func (Instance) DialogAutowrap

func (self Instance) DialogAutowrap() bool

func (Instance) DialogCloseOnEscape

func (self Instance) DialogCloseOnEscape() bool

func (Instance) DialogHideOnOk

func (self Instance) DialogHideOnOk() bool

func (Instance) DialogText

func (self Instance) DialogText() string

func (Instance) GetLabel

func (self Instance) GetLabel() Label.Instance

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

func (self Instance) GetOkButton() Button.Instance

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) ID

func (self Instance) ID() ID

func (Instance) MoreArgs

func (self Instance) MoreArgs() MoreArgs

MoreArgs enables certain functions to be called with additional 'optional' arguments.

func (Instance) OkButtonText

func (self Instance) OkButtonText() string

func (Instance) OnCanceled

func (self Instance) OnCanceled(cb func(), flags ...Signal.Flags)

func (Instance) OnConfirmed

func (self Instance) OnConfirmed(cb func(), flags ...Signal.Flags)

func (Instance) OnCustomAction

func (self Instance) OnCustomAction(cb func(action string), flags ...Signal.Flags)

func (Instance) RegisterTextEnter

func (self Instance) RegisterTextEnter(line_edit LineEdit.Instance)

Registers a LineEdit in the dialog. When the enter key is pressed, the dialog will be accepted.

func (Instance) RemoveButton

func (self Instance) RemoveButton(button Button.Instance)

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 (self Instance) SetDialogAutowrap(value bool)

func (Instance) SetDialogCloseOnEscape

func (self Instance) SetDialogCloseOnEscape(value bool)

func (Instance) SetDialogHideOnOk

func (self Instance) SetDialogHideOnOk(value bool)

func (Instance) SetDialogText

func (self Instance) SetDialogText(value string)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetOkButtonText

func (self Instance) SetOkButtonText(value string)

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type MoreArgs

type MoreArgs [1]gdclass.AcceptDialog

MoreArgs is a container for Instance functions with additional 'optional' arguments.

func (MoreArgs) AddButton

func (self MoreArgs) AddButton(text string, right bool, action string) Button.Instance

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL