Documentation ¶
Overview ¶
Package dialog provides common dialog boxes, such as message boxes, and open and save file dialogs.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialog ¶
type Dialog struct {
// contains filtered or unexported fields
}
Dialog contains some functionality used by all dialog types.
type Message ¶
type Message struct { Dialog // contains filtered or unexported fields }
Message is a builder to construct a message dialog to the user.
func NewMessage ¶
NewMessage initializes a new message object with the specified text. Use of the method Message on an existing Window is preferred, as the message can be set as a child of the top-level window.
Example ¶
// The following creates a modal dialog with a message. err := NewMessage("Some text for the body of the dialog box.").WithTitle("Example").WithInfo().Show() if err != nil { fmt.Println("Error: ", err) }
Output:
func (*Message) WithError ¶
WithError adds an icon to the message indicating that an error has occurred.
func (*Message) WithInfo ¶
WithInfo adds an icon to the message indicating that the message is informational.
type OpenFile ¶
type OpenFile struct { Dialog // contains filtered or unexported fields }
OpenFile is a builder to construct an open file dialog to the user.
func NewOpenFile ¶
func NewOpenFile() *OpenFile
NewOpenFile initializes a new open file dialog. Use of the method OpenFileDialog on an existing Window is preferred, as the message can be set as a child of the top-level window.
func (*OpenFile) AddFilter ¶
AddFilter adds a filter to the list of filename patterns that the user can select.
func (*OpenFile) WithFilename ¶
WithFilename sets the current or default filename for the dialog.
type Owner ¶ added in v0.9.0
type Owner struct {
Handle uintptr
}
Owner holds a pointer to the owning window. This type varies between platforms.
type SaveFile ¶
type SaveFile struct { Dialog // contains filtered or unexported fields }
SaveFile is a builder to construct an open file dialog to the user.
func NewSaveFile ¶
func NewSaveFile() *SaveFile
NewSaveFile initializes a new open file dialog. Use of the method SaveFileDialog on an existing Window is preferred, as the message can be set as a child of the top-level window.
func (*SaveFile) AddFilter ¶
AddFilter adds a filter to the list of filename patterns that the user can select.
func (*SaveFile) WithFilename ¶
WithFilename sets the current or default filename for the dialog.