dialog

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: BSD-3-Clause Imports: 40 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dialog defines standard dialog windows for application GUIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAboutWindow

func NewAboutWindow(content string, links []*widget.Hyperlink, a bellui.App) bellui.Window

NewAboutWindow creates an about window for the given app: its metadata icon, name and version above the markdown content, with the links in a row along the bottom. You should call Show on the returned window to display it.

Since: 1.0

func ShowAbout

func ShowAbout(content string, links []*widget.Hyperlink, a bellui.App, w bellui.Window)

ShowAbout opens an about dialog built from the app metadata along with the markdown content and links passed into this method.

Since: 1.0

func ShowAboutWindow

func ShowAboutWindow(content string, links []*widget.Hyperlink, a bellui.App)

ShowAboutWindow opens an about window built from the app metadata along with the markdown content and links passed into this method.

Since: 1.0

func ShowColorPicker

func ShowColorPicker(title, message string, callback func(c color.Color), parent bellui.Window)

ShowColorPicker creates and shows a color dialog. The callback is triggered when the user selects a color.

Since: 1.0

func ShowConfirm

func ShowConfirm(title, message string, callback func(bool), parent bellui.Window)

ShowConfirm shows a dialog over the specified window for a user confirmation. The title is used for the dialog window and message is the content. The callback is executed when the user decides.

func ShowCustom

func ShowCustom(title, dismiss string, content core.CanvasObject, parent bellui.Window)

ShowCustom shows a dialog over the specified application using custom content. The button will have the dismiss text set. The MinSize() of the CanvasObject passed will be used to set the size of the window.

func ShowCustomConfirm

func ShowCustomConfirm(title, confirm, dismiss string, content core.CanvasObject,
	callback func(bool), parent bellui.Window,
)

ShowCustomConfirm shows a dialog over the specified application using custom content. The cancel button will have the dismiss text set and the "OK" will use the confirm text. The response callback is called on user action. The MinSize() of the CanvasObject passed will be used to set the size of the window.

func ShowCustomWithoutButtons

func ShowCustomWithoutButtons(title string, content core.CanvasObject, parent bellui.Window)

ShowCustomWithoutButtons shows a dialog, without buttons, over the specified application using custom content. The MinSize() of the CanvasObject passed will be used to set the size of the window.

Since: 1.0

func ShowError

func ShowError(err error, parent bellui.Window)

ShowError shows a dialog over the specified window for an application error. The message is extracted from the provided error (should not be nil).

func ShowFileOpen

func ShowFileOpen(callback func(reader bellui.URIReadCloser, err error), parent bellui.Window)

ShowFileOpen creates and shows a file dialog allowing the user to choose a file to open.

The callback function will run when the dialog closes and provide a reader for the chosen file. The reader will be nil when the user cancels or when nothing is selected. When the reader isn't nil it must be closed by the callback.

The dialog will appear over the window specified.

func ShowFileOpenMultiple

func ShowFileOpenMultiple(callback func(readers []bellui.URIReadCloser, err error), parent bellui.Window)

ShowFileOpenMultiple creates and shows a file dialog allowing the user to choose one or more files to open.

The dialog will appear over the window specified.

Since: 1.0

func ShowFileSave

func ShowFileSave(callback func(writer bellui.URIWriteCloser, err error), parent bellui.Window)

ShowFileSave creates and shows a file dialog allowing the user to choose a file to save to (new or overwrite). If the user chooses an existing file they will be asked if they are sure.

The callback function will run when the dialog closes and provide a writer for the chosen file. The writer will be nil when the user cancels or when nothing is selected. When the writer isn't nil it must be closed by the callback.

The dialog will appear over the window specified.

func ShowFolderOpen

func ShowFolderOpen(callback func(bellui.ListableURI, error), parent bellui.Window)

ShowFolderOpen creates and shows a file dialog allowing the user to choose a folder to open. The callback function will run when the dialog closes. The URI will be nil when the user cancels or when nothing is selected.

The dialog will appear over the window specified.

Since: 1.0

func ShowForm

func ShowForm(title, confirm, dismiss string, content []*widget.FormItem, callback func(bool), parent bellui.Window)

ShowForm shows 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. The MinSize() of the CanvasObject passed will be used to set the size of the window.

Since: 1.0

func ShowInformation

func ShowInformation(title, message string, parent bellui.Window)

ShowInformation shows a dialog over the specified window for user information. The title is used for the dialog window and message is the content.

func UseNativeFileDialogs

func UseNativeFileDialogs(enable bool)

UseNativeFileDialogs enables (or disables) the platform-native file dialog backends for FileOpen, FileSave and FolderOpen: NSOpenPanel/NSSavePanel on macOS, IFileOpenDialog/IFileSaveDialog on Windows, the org.freedesktop.portal.FileChooser portal on Linux/BSD, and the system document pickers on iOS and Android (#267).

They are used by default: a file picker is where users expect their own sidebar, favourites, search and network mounts, and on Linux the portal is the only backend that works inside Flatpak/Snap. Pass false to force the canvas-drawn dialog everywhere instead. On iOS and Android that choice carries a real cost: the platform picker is the only surface that reaches outside the app sandbox on modern mobile systems, so the canvas dialog browses app-scoped storage only — an app opting out for desktop-consistency reasons should gate the call on the platform.

When the native backend cannot serve a request the canvas-drawn dialog is used, so an app never loses the feature. That covers no portal on the bus, an unsupported platform, and a window with no platform handle behind it. The SetShowHidden toggle is canvas-dialog-only; the native surfaces cannot express it.

Two exceptions ignore this setting: Flatpak builds always use the portal (the only dialog that can see outside the sandbox), and on wasm both overrides stay the browser's own — the <input type="file"> picker for open and the download offered at writer close for save — because a canvas dialog has no real filesystem to browse there.

Since: 1.0. The native backends were opt-in when introduced; the default changed to enabled before the first stable release (#226).

Types

type ColorPickerDialog

type ColorPickerDialog struct {
	Advanced bool
	// contains filtered or unexported fields
}

ColorPickerDialog is a simple dialog window that displays a color picker.

Since: 1.0

func NewColorPicker

func NewColorPicker(title, message string, callback func(c color.Color), parent bellui.Window) *ColorPickerDialog

NewColorPicker creates a color dialog and returns the handle. Using the returned type you should call Show() and then set its color through SetColor(). The callback is triggered when the user selects a color.

Since: 1.0

func (ColorPickerDialog) Dismiss

func (d ColorPickerDialog) Dismiss()

func (ColorPickerDialog) Hide

func (d ColorPickerDialog) Hide()

func (ColorPickerDialog) MinSize

func (d ColorPickerDialog) MinSize() geo.Size

MinSize returns the size that this dialog should not shrink below.

Since: 1.0

func (*ColorPickerDialog) Refresh

func (p *ColorPickerDialog) Refresh()

Refresh causes this dialog to be updated

func (ColorPickerDialog) Resize

func (d ColorPickerDialog) Resize(size geo.Size)

Resize dialog, call this function after dialog show

func (*ColorPickerDialog) SetColor

func (p *ColorPickerDialog) SetColor(c color.Color)

SetColor updates the color of the color picker.

func (ColorPickerDialog) SetDismissText

func (d ColorPickerDialog) 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 (ColorPickerDialog) SetOnClosed

func (d ColorPickerDialog) SetOnClosed(closed func())

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

func (ColorPickerDialog) SetWindowHosted

func (d ColorPickerDialog) SetWindowHosted(hosted bool)

SetWindowHosted controls whether Show opens this dialog in its own native window instead of an overlay inside the parent window's canvas. While the dialog window is open the parent window is blocked by a modal scrim (tapping it focuses the dialog window); other application windows stay interactive. Closing the dialog window — its close button or the Escape key — dismisses the dialog as if the cancel button were tapped. On single-window platforms (mobile, web) the mode is ignored and the dialog falls back to the standard overlay presentation. Call before Show.

Since: 1.0

func (ColorPickerDialog) SetWindowed

func (d ColorPickerDialog) SetWindowed(windowed bool)

SetWindowed controls whether the dialog is hosted in a window frame that the user can drag by its title bar and resize from its corners. Windowed is the default; pass false for a fixed, centered dialog. Call before Show.

func (*ColorPickerDialog) Show

func (p *ColorPickerDialog) Show()

Show causes this dialog to be displayed

type ConfirmDialog

type ConfirmDialog struct {
	// contains filtered or unexported fields
}

ConfirmDialog is like the standard Dialog but with an additional confirmation button

func NewConfirm

func NewConfirm(title, message string, callback func(bool), parent bellui.Window) *ConfirmDialog

NewConfirm creates a dialog over the specified window for user confirmation. The title is used for the dialog window and message is the content. The callback is executed when the user decides. After creation you should call Show().

func NewCustomConfirm

func NewCustomConfirm(title, confirm, dismiss string, content core.CanvasObject,
	callback func(bool), parent bellui.Window,
) *ConfirmDialog

NewCustomConfirm creates and returns a dialog over the specified application using custom content. The cancel button will have the dismiss text set and the "OK" will use the confirm text. The response callback is called on user action. The MinSize() of the CanvasObject passed will be used to set the size of the window.

func (*ConfirmDialog) Confirm

func (d *ConfirmDialog) Confirm()

Confirm instructs the dialog to close agreeing with whatever content was displayed.

Since: 1.0

func (ConfirmDialog) Dismiss

func (d ConfirmDialog) Dismiss()

func (ConfirmDialog) Hide

func (d ConfirmDialog) Hide()

func (ConfirmDialog) MinSize

func (d ConfirmDialog) MinSize() geo.Size

MinSize returns the size that this dialog should not shrink below.

Since: 1.0

func (ConfirmDialog) Refresh

func (d ConfirmDialog) Refresh()

func (ConfirmDialog) Resize

func (d ConfirmDialog) Resize(size geo.Size)

Resize dialog, call this function after dialog show

func (*ConfirmDialog) SetConfirmImportance

func (d *ConfirmDialog) SetConfirmImportance(importance widget.Importance)

SetConfirmImportance sets the importance level of the confirm button.

Since: 1.0

func (*ConfirmDialog) SetConfirmText

func (d *ConfirmDialog) SetConfirmText(label string)

SetConfirmText allows custom text to be set in the confirmation button

func (ConfirmDialog) SetDismissText

func (d ConfirmDialog) 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 (ConfirmDialog) SetOnClosed

func (d ConfirmDialog) SetOnClosed(closed func())

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

func (ConfirmDialog) SetWindowHosted

func (d ConfirmDialog) SetWindowHosted(hosted bool)

SetWindowHosted controls whether Show opens this dialog in its own native window instead of an overlay inside the parent window's canvas. While the dialog window is open the parent window is blocked by a modal scrim (tapping it focuses the dialog window); other application windows stay interactive. Closing the dialog window — its close button or the Escape key — dismisses the dialog as if the cancel button were tapped. On single-window platforms (mobile, web) the mode is ignored and the dialog falls back to the standard overlay presentation. Call before Show.

Since: 1.0

func (ConfirmDialog) SetWindowed

func (d ConfirmDialog) SetWindowed(windowed bool)

SetWindowed controls whether the dialog is hosted in a window frame that the user can drag by its title bar and resize from its corners. Windowed is the default; pass false for a fixed, centered dialog. Call before Show.

func (ConfirmDialog) Show

func (d ConfirmDialog) Show()

type CustomDialog

type CustomDialog struct {
	// contains filtered or unexported fields
}

CustomDialog implements a custom dialog.

Since: 1.0

func NewCustom

func NewCustom(title, dismiss string, content core.CanvasObject, parent bellui.Window) *CustomDialog

NewCustom creates and returns a dialog over the specified application using custom content. The button will have the dismiss text set. The MinSize() of the CanvasObject passed will be used to set the size of the window.

func NewCustomWithoutButtons

func NewCustomWithoutButtons(title string, content core.CanvasObject, parent bellui.Window) *CustomDialog

NewCustomWithoutButtons creates a new custom dialog without any buttons. The MinSize() of the CanvasObject passed will be used to set the size of the window.

Since: 1.0

func (CustomDialog) Dismiss

func (d CustomDialog) Dismiss()

func (CustomDialog) Hide

func (d CustomDialog) Hide()

func (CustomDialog) MinSize

func (d CustomDialog) MinSize() geo.Size

MinSize returns the size that this dialog should not shrink below.

Since: 1.0

func (CustomDialog) Refresh

func (d CustomDialog) Refresh()

func (CustomDialog) Resize

func (d CustomDialog) Resize(size geo.Size)

Resize dialog, call this function after dialog show

func (*CustomDialog) SetButtons

func (d *CustomDialog) SetButtons(buttons []core.CanvasObject)

SetButtons sets the row of buttons at the bottom of the dialog. Passing an empty slice will result in a dialog with no buttons.

Since: 1.0

func (CustomDialog) SetDismissText

func (d CustomDialog) 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 (*CustomDialog) SetIcon

func (d *CustomDialog) SetIcon(icon bellui.Resource)

SetIcon sets an icon to be shown in the top right of the dialog. Passing a nil resource will remove the icon from the dialog.

Since: 1.0

func (CustomDialog) SetOnClosed

func (d CustomDialog) SetOnClosed(closed func())

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

func (CustomDialog) SetWindowHosted

func (d CustomDialog) SetWindowHosted(hosted bool)

SetWindowHosted controls whether Show opens this dialog in its own native window instead of an overlay inside the parent window's canvas. While the dialog window is open the parent window is blocked by a modal scrim (tapping it focuses the dialog window); other application windows stay interactive. Closing the dialog window — its close button or the Escape key — dismisses the dialog as if the cancel button were tapped. On single-window platforms (mobile, web) the mode is ignored and the dialog falls back to the standard overlay presentation. Call before Show.

Since: 1.0

func (CustomDialog) SetWindowed

func (d CustomDialog) SetWindowed(windowed bool)

SetWindowed controls whether the dialog is hosted in a window frame that the user can drag by its title bar and resize from its corners. Windowed is the default; pass false for a fixed, centered dialog. Call before Show.

func (CustomDialog) Show

func (d CustomDialog) Show()

type Dialog

type Dialog interface {
	Show()
	Hide()
	SetDismissText(label string)
	SetOnClosed(closed func())
	Refresh()
	Resize(size geo.Size)

	// MinSize returns the size that this dialog should not shrink below.
	//
	// Since: 1.0
	MinSize() geo.Size

	// Dismiss instructs the dialog to close without any affirmative action.
	//
	// Since: 1.0
	Dismiss()

	// SetWindowed controls whether the dialog is hosted in a window frame
	// that the user can drag by its title bar and resize from its corners.
	// Windowed is the default; pass false for a fixed, centered dialog.
	// Call before Show.
	SetWindowed(windowed bool)

	// SetWindowHosted controls whether Show opens this dialog in its own
	// native window instead of an overlay inside the parent window's canvas.
	// While the dialog window is open the parent window is blocked by a
	// modal scrim; other application windows stay interactive
	// (window-modal). On single-window platforms (mobile, web) the mode is
	// ignored and the dialog falls back to the standard overlay
	// presentation. Call before Show.
	//
	// Since: 1.0
	SetWindowHosted(hosted bool)
}

Dialog is the common API for any dialog window with a single dismiss button

func NewAbout

func NewAbout(content string, links []*widget.Hyperlink, a bellui.App, w bellui.Window) Dialog

NewAbout creates an about dialog for the given app: its metadata icon, name and version above the markdown content, with the links in a row along the bottom. You should call Show on the returned dialog to display it.

Since: 1.0

func NewError

func NewError(err error, parent bellui.Window) Dialog

NewError creates a dialog over the specified window for an application error. The message is extracted from the provided error (should not be nil). After creation you should call Show().

func NewInformation

func NewInformation(title, message string, parent bellui.Window) Dialog

NewInformation creates a dialog over the specified window for user information. The title is used for the dialog window and message is the content. After creation you should call Show().

type FileDialog

type FileDialog struct {
	// contains filtered or unexported fields
}

FileDialog is a dialog containing a file picker for use in opening or saving files.

func NewFileOpen

func NewFileOpen(callback func(reader bellui.URIReadCloser, err error), parent bellui.Window) *FileDialog

NewFileOpen creates a file dialog allowing the user to choose a file to open.

The callback function will run when the dialog closes and provide a reader for the chosen file. The reader will be nil when the user cancels or when nothing is selected. When the reader isn't nil it must be closed by the callback.

The dialog will appear over the window specified when Show() is called.

func NewFileOpenMultiple

func NewFileOpenMultiple(callback func(readers []bellui.URIReadCloser, err error), parent bellui.Window) *FileDialog

NewFileOpenMultiple creates a file dialog allowing the user to choose one or more files to open. It is the multi-select counterpart to NewFileOpen; the callback receives every chosen file (or a nil slice when the user cancels). Each non-nil reader must be closed by the callback.

Multi-select is only available in the canvas-drawn dialog for now, so a multi-select open dialog always uses it even when UseNativeFileDialogs is enabled (native multi-select is a follow-up).

The dialog will appear over the window specified when Show() is called.

Since: 1.0

func NewFileSave

func NewFileSave(callback func(writer bellui.URIWriteCloser, err error), parent bellui.Window) *FileDialog

NewFileSave creates a file dialog allowing the user to choose a file to save to (new or overwrite). If the user chooses an existing file they will be asked if they are sure.

The callback function will run when the dialog closes and provide a writer for the chosen file. The writer will be nil when the user cancels or when nothing is selected. When the writer isn't nil it must be closed by the callback.

The dialog will appear over the window specified when Show() is called.

func NewFolderOpen

func NewFolderOpen(callback func(bellui.ListableURI, error), parent bellui.Window) *FileDialog

NewFolderOpen creates a file dialog allowing the user to choose a folder to open. The callback function will run when the dialog closes. The URI will be nil when the user cancels or when nothing is selected.

The dialog will appear over the window specified when Show() is called.

Since: 1.0

func (*FileDialog) Dismiss

func (f *FileDialog) Dismiss()

Dismiss instructs the dialog to close without any affirmative action.

Since: 1.0

func (*FileDialog) Hide

func (f *FileDialog) Hide()

Hide hides the file dialog.

func (*FileDialog) MinSize

func (f *FileDialog) MinSize() geo.Size

MinSize returns the size that this dialog should not shrink below

Since: 1.0

func (*FileDialog) Refresh

func (f *FileDialog) Refresh()

Refresh causes this dialog to be updated

func (*FileDialog) Resize

func (f *FileDialog) Resize(size geo.Size)

Resize dialog to the requested size, if there is sufficient space. If the parent window is not large enough then the size will be reduced to fit.

func (*FileDialog) SetConfirmText

func (f *FileDialog) SetConfirmText(label string)

SetConfirmText allows custom text to be set in the confirmation button

Since: 1.0

func (*FileDialog) SetDismissText

func (f *FileDialog) SetDismissText(label string)

SetDismissText allows custom text to be set in the dismiss button

func (*FileDialog) SetFileName

func (f *FileDialog) SetFileName(fileName string)

SetFileName sets the filename in a FileDialog in save mode. This is normally called before the dialog is shown.

func (*FileDialog) SetFilter

func (f *FileDialog) SetFilter(filter storage.FileFilter)

SetFilter sets a filter for limiting files that can be chosen in the file dialog.

func (*FileDialog) SetLocation

func (f *FileDialog) SetLocation(u bellui.ListableURI)

SetLocation tells this FileDialog which location to display. This is normally called before the dialog is shown.

Since: 1.0

func (*FileDialog) SetMultiSelect

func (f *FileDialog) SetMultiSelect(multi bool)

SetMultiSelect enables or disables choosing more than one file. It only applies to an open dialog (not save or folder). When enabled, use NewFileOpenMultiple/ShowFileOpenMultiple or supply a func([]bellui.URIReadCloser, error) callback; the canvas dialog then lets the user extend the selection with Ctrl/Cmd-click (toggle) and Shift-click (range). Call before the dialog is shown.

Since: 1.0

func (*FileDialog) SetOnClosed

func (f *FileDialog) SetOnClosed(closed func())

SetOnClosed sets a callback function that is called when the dialog is closed. It fires immediately before the result callback, whether the dialog is the canvas-drawn one or a platform-native picker.

One exception: the web (wasm) save dialog has no picker — closing the returned writer offers the browser download that stands in for it — so there the callback fires when the writer is closed, after the result callback, and never if the writer is abandoned.

func (*FileDialog) SetShowHidden

func (f *FileDialog) SetShowHidden(show bool)

SetShowHidden sets whether the dialog should display hidden files. This is normally called before the dialog is shown.

Since: 1.0

func (*FileDialog) SetTitleText

func (f *FileDialog) SetTitleText(label string)

SetTitleText allows custom text to be set in the dialog title

Since: 1.0

func (*FileDialog) SetView

func (f *FileDialog) SetView(v ViewLayout)

SetView changes the default display view of the FileDialog This is normally called before the dialog is shown.

Since: 1.0

func (*FileDialog) SetWindowHosted

func (f *FileDialog) SetWindowHosted(hosted bool)

SetWindowHosted controls whether Show opens this file dialog in its own native window instead of an overlay inside the parent window's canvas. While the dialog window is open the parent window is blocked by a modal scrim; other application windows stay interactive (window-modal). Closing the dialog window — its close button or the Escape key — dismisses the dialog as if Cancel were tapped. On single-window platforms (mobile, web) the mode is ignored and the dialog falls back to the standard overlay presentation. Call before Show.

Since: 1.0

func (*FileDialog) SetWindowed

func (f *FileDialog) SetWindowed(windowed bool)

SetWindowed controls whether the dialog is hosted in a window frame that the user can drag by its title bar and resize from its corners. Windowed is the default; pass false for a fixed, centered dialog. Call before Show.

func (*FileDialog) Show

func (f *FileDialog) Show()

Show shows the file dialog.

type FormDialog

type FormDialog struct {
	// contains filtered or unexported fields
}

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

Since: 1.0

func NewForm

func NewForm(title, confirm, dismiss string, items []*widget.FormItem, callback func(bool), parent bellui.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: 1.0

func (FormDialog) Dismiss

func (d FormDialog) Dismiss()

func (FormDialog) Hide

func (d FormDialog) Hide()

func (FormDialog) MinSize

func (d FormDialog) MinSize() geo.Size

MinSize returns the size that this dialog should not shrink below.

Since: 1.0

func (FormDialog) Refresh

func (d FormDialog) Refresh()

func (FormDialog) Resize

func (d FormDialog) Resize(size geo.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) SetWindowHosted

func (d FormDialog) SetWindowHosted(hosted bool)

SetWindowHosted controls whether Show opens this dialog in its own native window instead of an overlay inside the parent window's canvas. While the dialog window is open the parent window is blocked by a modal scrim (tapping it focuses the dialog window); other application windows stay interactive. Closing the dialog window — its close button or the Escape key — dismisses the dialog as if the cancel button were tapped. On single-window platforms (mobile, web) the mode is ignored and the dialog falls back to the standard overlay presentation. Call before Show.

Since: 1.0

func (FormDialog) SetWindowed

func (d FormDialog) SetWindowed(windowed bool)

SetWindowed controls whether the dialog is hosted in a window frame that the user can drag by its title bar and resize from its corners. Windowed is the default; pass false for a fixed, centered dialog. Call before Show.

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: 1.0

type ViewLayout

type ViewLayout int

ViewLayout can be passed to SetView() to set the view of a FileDialog

Since: 1.0

const (
	ListView ViewLayout
	GridView
)

Jump to

Keyboard shortcuts

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