Documentation ¶
Overview ¶
Package dialog defines standard dialog windows for application GUIs
Index ¶
- func NewFileIcon(uri fyne.URI) fyne.CanvasObject
- func ShowConfirm(title, message string, callback func(bool), parent fyne.Window)
- func ShowCustom(title, dismiss string, content fyne.CanvasObject, parent fyne.Window)
- func ShowCustomConfirm(title, confirm, dismiss string, content fyne.CanvasObject, callback func(bool), ...)
- func ShowError(err error, parent fyne.Window)
- func ShowFileOpen(callback func([]fyne.URIReadCloser, error), parent fyne.Window)
- func ShowFileSave(callback func(fyne.URIWriteCloser, error), parent fyne.Window)
- func ShowInformation(title, message string, parent fyne.Window)
- type ConfirmDialog
- func (d ConfirmDialog) Hide()
- func (d ConfirmDialog) Layout(obj []fyne.CanvasObject, size fyne.Size)
- func (d ConfirmDialog) MinSize(obj []fyne.CanvasObject) fyne.Size
- func (d *ConfirmDialog) SetConfirmText(label string)
- func (d ConfirmDialog) SetDismissText(label string)
- func (d ConfirmDialog) SetOnClosed(closed func())
- func (d ConfirmDialog) Show()
- type Dialog
- func NewCustom(title, dismiss string, content fyne.CanvasObject, parent fyne.Window) Dialog
- func NewCustomConfirm(title, confirm, dismiss string, content fyne.CanvasObject, callback func(bool), ...) Dialog
- func NewError(err error, parent fyne.Window) Dialog
- func NewInformation(title, message string, parent fyne.Window) Dialog
- type FileDialog
- type ProgressDialog
- func (d ProgressDialog) Hide()
- func (d ProgressDialog) Layout(obj []fyne.CanvasObject, size fyne.Size)
- func (d ProgressDialog) MinSize(obj []fyne.CanvasObject) fyne.Size
- func (d ProgressDialog) SetDismissText(label string)
- func (d ProgressDialog) SetOnClosed(closed func())
- func (p *ProgressDialog) SetValue(v float64)
- func (d ProgressDialog) Show()
- type ProgressInfiniteDialog
- func (d *ProgressInfiniteDialog) Hide()
- func (d ProgressInfiniteDialog) Layout(obj []fyne.CanvasObject, size fyne.Size)
- func (d ProgressInfiniteDialog) MinSize(obj []fyne.CanvasObject) fyne.Size
- func (d ProgressInfiniteDialog) SetDismissText(label string)
- func (d ProgressInfiniteDialog) SetOnClosed(closed func())
- func (d ProgressInfiniteDialog) Show()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileIcon ¶ added in v1.3.1
func NewFileIcon(uri fyne.URI) fyne.CanvasObject
NewFileIcon takes a filepath and creates an icon with an overlayed label using the detected mimetype and extension
func ShowConfirm ¶
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 fyne.CanvasObject, parent fyne.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 fyne.CanvasObject, callback func(bool), parent fyne.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 ShowError ¶
ShowError shows a dialog over the specified window for an application error. The title and message are extracted from the provided error.
func ShowFileOpen ¶ added in v1.3.1
func ShowFileOpen(callback func([]fyne.URIReadCloser, error), parent fyne.Window)
ShowFileOpen creates and shows a file dialog allowing the user to choose a file to open. The dialog will appear over the window specified.
func ShowFileSave ¶ added in v1.3.1
func ShowFileSave(callback func(fyne.URIWriteCloser, error), parent fyne.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 dialog will appear over the window specified.
func ShowInformation ¶
ShowInformation shows a dialog over the specified window for user information. The title is used for the dialog window and message is the content.
Types ¶
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 fyne.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 (ConfirmDialog) Layout ¶
func (d ConfirmDialog) Layout(obj []fyne.CanvasObject, size fyne.Size)
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 confirmation button
func (ConfirmDialog) SetOnClosed ¶ added in v1.3.1
func (d ConfirmDialog) SetOnClosed(closed func())
SetOnClosed allows to set a callback function that is called when the dialog is closed
type Dialog ¶
type Dialog interface { Show() Hide() SetDismissText(label string) SetOnClosed(closed func()) }
Dialog is the common API for any dialog window with a single dismiss button
func NewCustom ¶ added in v1.3.1
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 NewCustomConfirm ¶ added in v1.3.1
func NewCustomConfirm(title, confirm, dismiss string, content fyne.CanvasObject, callback func(bool), parent fyne.Window) Dialog
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.
type FileDialog ¶ added in v1.3.1
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 ¶ added in v1.3.1
func NewFileOpen(callback func([]fyne.URIReadCloser, error), parent fyne.Window) *FileDialog
NewFileOpen creates a file dialog allowing the user to choose a file to open. The dialog will appear over the window specified when Show() is called.
func NewFileSave ¶ added in v1.3.1
func NewFileSave(callback func(fyne.URIWriteCloser, error), parent fyne.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 dialog will appear over the window specified when Show() is called.
func (*FileDialog) SetDismissText ¶ added in v1.3.1
func (f *FileDialog) SetDismissText(label string)
SetDismissText allows custom text to be set in the confirmation button
func (*FileDialog) SetFilter ¶ added in v1.3.1
func (f *FileDialog) SetFilter(filter storage.FileFilter)
SetFilter sets a filter for limiting files that can be chosen in the file dialog.
func (*FileDialog) SetMultiSelect ¶ added in v1.3.1
func (f *FileDialog) SetMultiSelect(multiSelect bool)
SetFilter sets a filter for limiting files that can be chosen in the file dialog.
func (*FileDialog) SetOnClosed ¶ added in v1.3.1
func (f *FileDialog) SetOnClosed(closed func())
SetOnClosed sets a callback function that is called when the dialog is closed.
type ProgressDialog ¶
type ProgressDialog struct {
// contains filtered or unexported fields
}
ProgressDialog is a simple dialog window that displays text and a progress bar.
func NewProgress ¶
func NewProgress(title, message string, parent fyne.Window) *ProgressDialog
NewProgress creates a progress dialog and returns the handle. Using the returned type you should call Show() and then set its value through SetValue().
func (ProgressDialog) Layout ¶
func (d ProgressDialog) Layout(obj []fyne.CanvasObject, size fyne.Size)
func (ProgressDialog) SetDismissText ¶
func (d ProgressDialog) SetDismissText(label string)
SetDismissText allows custom text to be set in the confirmation button
func (ProgressDialog) SetOnClosed ¶ added in v1.3.1
func (d ProgressDialog) SetOnClosed(closed func())
SetOnClosed allows to set a callback function that is called when the dialog is closed
func (*ProgressDialog) SetValue ¶
func (p *ProgressDialog) SetValue(v float64)
SetValue updates the value of the progress bar - this should be between 0.0 and 1.0.
type ProgressInfiniteDialog ¶ added in v1.3.1
type ProgressInfiniteDialog struct {
// contains filtered or unexported fields
}
ProgressInfiniteDialog is a simple dialog window that displays text and a infinite progress bar.
func NewProgressInfinite ¶ added in v1.3.1
func NewProgressInfinite(title, message string, parent fyne.Window) *ProgressInfiniteDialog
NewProgressInfinite creates a infinite progress dialog and returns the handle. Using the returned type you should call Show().
func (*ProgressInfiniteDialog) Hide ¶ added in v1.3.1
func (d *ProgressInfiniteDialog) Hide()
Hide this dialog and stop the infinite progress goroutine
func (ProgressInfiniteDialog) Layout ¶ added in v1.3.1
func (d ProgressInfiniteDialog) Layout(obj []fyne.CanvasObject, size fyne.Size)
func (ProgressInfiniteDialog) MinSize ¶ added in v1.3.1
func (d ProgressInfiniteDialog) MinSize(obj []fyne.CanvasObject) fyne.Size
func (ProgressInfiniteDialog) SetDismissText ¶ added in v1.3.1
func (d ProgressInfiniteDialog) SetDismissText(label string)
SetDismissText allows custom text to be set in the confirmation button
func (ProgressInfiniteDialog) SetOnClosed ¶ added in v1.3.1
func (d ProgressInfiniteDialog) SetOnClosed(closed func())
SetOnClosed allows to set a callback function that is called when the dialog is closed