options

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 6 Imported by: 202

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = &App{
	Title:    "My Wails App",
	Width:    1024,
	Height:   768,
	DevTools: false,
	RGBA:     0xFFFFFFFF,
	Mac: &mac.Options{
		TitleBar:                      mac.TitleBarDefault(),
		Appearance:                    mac.DefaultAppearance,
		WebviewIsTransparent:          false,
		WindowBackgroundIsTranslucent: false,
	},
	Logger:   logger.NewDefaultLogger(),
	LogLevel: logger.INFO,
}

Default options for creating the App

Functions

func GetApplicationMenu

func GetApplicationMenu(appoptions *App) *menu.Menu

func GetContextMenus

func GetContextMenus(appoptions *App) *menu.ContextMenus

func GetTray

func GetTray(appoptions *App) *menu.TrayOptions

func MergeDefaults

func MergeDefaults(appoptions *App)

MergeDefaults will set the minimum default values for an application

Types

type App

type App struct {
	Title         string
	Width         int
	Height        int
	DisableResize bool
	Fullscreen    bool
	MinWidth      int
	MinHeight     int
	MaxWidth      int
	MaxHeight     int
	StartHidden   bool
	DevTools      bool
	RGBA          int
	ContextMenus  *menu.ContextMenus
	Tray          *menu.TrayOptions
	Menu          *menu.Menu
	Mac           *mac.Options
	Logger        logger.Logger `json:"-"`
	LogLevel      logger.LogLevel
}

App contains options for creating the App

type DialogType

type DialogType string
const (
	InfoDialog     DialogType = "info"
	WarningDialog  DialogType = "warning"
	ErrorDialog    DialogType = "error"
	QuestionDialog DialogType = "question"
)

type MessageDialog

type MessageDialog struct {
	Type          DialogType
	Title         string
	Message       string
	Buttons       []string
	DefaultButton string
	CancelButton  string
	Icon          string
}

MessageDialog contains the options for the Message dialogs, EG Info, Warning, etc runtime methods

type OpenDialog

type OpenDialog struct {
	DefaultDirectory           string
	DefaultFilename            string
	Title                      string
	Filters                    string
	AllowFiles                 bool
	AllowDirectories           bool
	AllowMultiple              bool
	ShowHiddenFiles            bool
	CanCreateDirectories       bool
	ResolvesAliases            bool
	TreatPackagesAsDirectories bool
}

OpenDialog contains the options for the OpenDialog runtime method

type SaveDialog

type SaveDialog struct {
	DefaultDirectory           string
	DefaultFilename            string
	Title                      string
	Filters                    string
	ShowHiddenFiles            bool
	CanCreateDirectories       bool
	TreatPackagesAsDirectories bool
}

SaveDialog contains the options for the SaveDialog runtime method

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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