wailsutil

package module
v0.0.0-...-4fd775f Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CareteDir

func CareteDir(path string)

*

  • 创建文件夹

func GetCurrentDirectory

func GetCurrentDirectory() string

获取当前执行程序目录

func InitLog

func InitLog()

Init 初始化日志文件

func LockFile

func LockFile() bool

*

  • 文件加锁

func PathExists

func PathExists(path string) (bool, error)

*

  • 判断文件夹是否存在

func ReadConfig

func ReadConfig(file string, section string, key string) string

*

  • 读取配置文件中指定块下的指定键

func SaveWindowInfo

func SaveWindowInfo(ctx context.Context)

func WailsOptions

func WailsOptions(jsBind []interface{}, iconInfos map[string][]byte, assets embed.FS, uuid string) *options.App

jsBind 必须是指针

Types

type AppFun

type AppFun struct {
	GiWidth      int
	GiHeight     int
	GiTop        int
	GiLeft       int
	GisMaxWindow bool
	ClearTrayFun func() //清理托盘函数
	// contains filtered or unexported fields
}

App struct

func NewApp

func NewApp(sIniFilePath, sysType string) *AppFun

NewApp creates a new App application struct

func (*AppFun) BeforeClose

func (a *AppFun) BeforeClose(ctx context.Context) (prevent bool)

func (*AppFun) ChangeWindowOnTop

func (a *AppFun) ChangeWindowOnTop() bool

设置窗口置顶或取消置顶

func (*AppFun) CloseApp

func (a *AppFun) CloseApp() string

func (*AppFun) CloseAppNoQuest

func (a *AppFun) CloseAppNoQuest()

func (*AppFun) ErrorMsg

func (a *AppFun) ErrorMsg(sTitle, sMessage string)

Error消息

func (*AppFun) HasWindow

func (a *AppFun) HasWindow() string

func (*AppFun) InfoMsg

func (a *AppFun) InfoMsg(sTitle, sMessage string)

Info消息

func (*AppFun) IsWindowOnTop

func (a *AppFun) IsWindowOnTop() bool

设置窗口置顶或取消置顶

func (*AppFun) OpenDirectoryDialog

func (a *AppFun) OpenDirectoryDialog(dialogOption string) *msgentity.MsgEntity

打开选择目录对话框

func (*AppFun) OpenFile

func (a *AppFun) OpenFile(defaultPath string) *msgentity.MsgEntity

打开文件

func (*AppFun) OpenFileDialog

func (a *AppFun) OpenFileDialog(dialogOption string) *msgentity.MsgEntity

打开选择文件对话框

func (*AppFun) QuestionMsg

func (a *AppFun) QuestionMsg(sTitle, sMessage string) string

Question消息

func (*AppFun) ReadFile

func (a *AppFun) ReadFile(path string) *msgentity.MsgEntity

读取指定文件内容

func (*AppFun) SaveAsFile

func (a *AppFun) SaveAsFile(defaultPath string, text string) *msgentity.MsgEntity

另存文件

func (*AppFun) SaveFile

func (a *AppFun) SaveFile(path string, text string) *msgentity.MsgEntity

保存文件内容

func (*AppFun) SaveFileDialog

func (a *AppFun) SaveFileDialog(dialogOption string) *msgentity.MsgEntity

打开保存文件对话框

func (*AppFun) SetWindwIsShow

func (a *AppFun) SetWindwIsShow(bl bool)

设置窗口显示状态值

func (*AppFun) Shutdown

func (a *AppFun) Shutdown(ctx context.Context)

在关闭过程结束时由 Wails 调用。 这是释放内存和执行关闭任务的好地方

func (*AppFun) Startup

func (a *AppFun) Startup(ctx context.Context)

一旦 Wails 分配了它需要的资源,就会调用 startup 方法,它是创建资源、设置事件侦听器以及应用程序在启动时需要的任何其他东西的好地方

func (*AppFun) SystemType

func (a *AppFun) SystemType() string

func (*AppFun) WarningMsg

func (a *AppFun) WarningMsg(sTitle, sMessage string)

Warning消息

func (*AppFun) WindowFullscreen

func (a *AppFun) WindowFullscreen()

使窗口全屏

func (*AppFun) WindowHide

func (a *AppFun) WindowHide()

隐藏窗口

func (*AppFun) WindowIsMaximised

func (a *AppFun) WindowIsMaximised() bool

窗口是否最大化

func (*AppFun) WindowIsMinimised

func (a *AppFun) WindowIsMinimised() bool

如果窗口最小化,则返回 true。

func (*AppFun) WindowMaximise

func (a *AppFun) WindowMaximise()

最大化窗口以填满屏幕

func (*AppFun) WindowMinimise

func (a *AppFun) WindowMinimise()

窗口最小化

func (*AppFun) WindowOnTop

func (a *AppFun) WindowOnTop(top bool)

设置窗口置顶或取消置顶

func (*AppFun) WindowPrint

func (a *AppFun) WindowPrint() string

Question消息

func (*AppFun) WindowShow

func (a *AppFun) WindowShow()

显示窗口

func (*AppFun) WindowToggleMaximise

func (a *AppFun) WindowToggleMaximise()

在最大化和未最大化之间切换

func (*AppFun) WindowUnminimise

func (a *AppFun) WindowUnminimise()

将窗口恢复到最小化之前的尺寸和位置

func (*AppFun) WindwIsShow

func (a *AppFun) WindwIsShow() bool

窗口是否显示

type CustomLogger

type CustomLogger struct{}

CustomLogger 实现github.com/wailsapp/wails/v2/pkg/logger里logger.Logger接口的自定义日志器的结构体

func GetLog

func GetLog() *CustomLogger

func (*CustomLogger) Critical

func (*CustomLogger) Critical(message string)

Critical 实现了 logger.Logger 接口的 Critical 方法

func (*CustomLogger) Debug

func (*CustomLogger) Debug(message string)

Debug 实现了 logger.Logger 接口的 Debug 方法

func (*CustomLogger) Error

func (*CustomLogger) Error(message string)

Error 实现了 logger.Logger 接口的 Error 方法

func (*CustomLogger) Fatal

func (*CustomLogger) Fatal(message string)

Fatal 实现了 logger.Logger 接口的 Fatal 方法

func (*CustomLogger) Info

func (*CustomLogger) Info(message string)

Info 实现了 logger.Logger 接口的 Info 方法

func (*CustomLogger) Print

func (*CustomLogger) Print(message string)

Panic 实现了 logger.Logger 接口的 Panic 方法

func (*CustomLogger) Trace

func (*CustomLogger) Trace(message string)

Panic 实现了 logger.Logger 接口的 Panic 方法

func (*CustomLogger) Warning

func (*CustomLogger) Warning(message string)

Warning 实现了 logger.Logger 接口的 Warning 方法

type FileLoader

type FileLoader struct {
	http.Handler
}

func NewFileLoader

func NewFileLoader() *FileLoader

func (*FileLoader) ServeHTTP

func (h *FileLoader) ServeHTTP(res http.ResponseWriter, req *http.Request)

type SystemTray

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

func (SystemTray) Run

func (st SystemTray) Run(appFun *AppFun, IconInfos map[string][]byte)

func (*SystemTray) SetHotkey

func (st *SystemTray) SetHotkey(FormHotkey string)

设置热键

Jump to

Keyboard shortcuts

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