Fyne API "dialog.FormDialog"

dialog.FormDialog


import "fyne.io/fyne/v2/dialog"

Usage

type FormDialog

type FormDialog struct {
}

FormDialog is a simple dialog window for displaying FormItems inside a form.

Since: 2.4

func NewForm

func NewForm(title, confirm, dismiss string, items []*widget.FormItem, callback func(bool), parent fyne.Window) *FormDialog

NewForm creates and returns a dialog over the specified application using the provided FormItems. The cancel button will have the dismiss text set and the confirm button will use the confirm text. The response callback is called on user action after validation passes. If any Validatable widget reports that validation has failed, then the confirm button will be disabled. The initial state of the confirm button will reflect the initial validation state of the items added to the form dialog.

Since: 2.0

func (FormDialog) Hide

func (d FormDialog) Hide()

func (FormDialog) MinSize

func (d FormDialog) MinSize() fyne.Size

MinSize returns the size that this dialog should not shrink below

Since: 2.1

func (FormDialog) Refresh

func (d FormDialog) Refresh()

func (FormDialog) Resize

func (d FormDialog) Resize(size fyne.Size)

Resize dialog, call this function after dialog show

func (FormDialog) SetDismissText

func (d FormDialog) SetDismissText(label string)

SetDismissText allows custom text to be set in the dismiss button This is a no-op for dialogs without dismiss buttons.

func (FormDialog) SetOnClosed

func (d FormDialog) SetOnClosed(closed func())

SetOnClosed allows to set a callback function that is called when the dialog is closed

func (FormDialog) Show

func (d FormDialog) Show()

func (*FormDialog) Submit

func (d *FormDialog) Submit()

Submit will submit the form and then hide the dialog if validation passes.

Since: 2.4