dialogs

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenFile

func OpenFile(opts FileDialogOptions) ([]string, error)

func SaveFile

func SaveFile(opts FileDialogOptions) (string, error)

func SelectFolder

func SelectFolder(opts FileDialogOptions) (string, error)

func SetProvider

func SetProvider(p Provider)

func ShowMessage

func ShowMessage(opts MessageBoxOptions) (string, error)

func ShowPrompt

func ShowPrompt(opts PromptOptions) (string, error)

Types

type FileDialogOptions

type FileDialogOptions struct {
	Title       string       `json:"title"`
	DefaultPath string       `json:"defaultPath,omitempty"`
	Filters     []FileFilter `json:"filters,omitempty"`
	Multiple    bool         `json:"multiple,omitempty"`
}

type FileFilter

type FileFilter struct {
	Name     string   `json:"name"`
	Patterns []string `json:"patterns"`
}

type MessageBoxOptions

type MessageBoxOptions struct {
	Title   string   `json:"title"`
	Message string   `json:"message"`
	Icon    string   `json:"icon,omitempty"`
	Buttons []string `json:"buttons,omitempty"`
}

type PromptOptions

type PromptOptions struct {
	Title        string `json:"title"`
	Message      string `json:"message"`
	DefaultValue string `json:"defaultValue"`
}

type Provider

type Provider interface {
	OpenFile(opts FileDialogOptions) ([]string, error)
	SaveFile(opts FileDialogOptions) (string, error)
	SelectFolder(opts FileDialogOptions) (string, error)
	ShowMessage(opts MessageBoxOptions) (string, error)
	ShowPrompt(opts PromptOptions) (string, error)
}

Provider is a native dialogs backend. On mobile the shell (Android Activity / iOS AppDelegate) registers one via SetProvider; on desktop the built-in platform implementations are used when no provider is set.

Jump to

Keyboard shortcuts

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