Files
file-tool-wails/main.go

41 lines
718 B
Go
Raw Normal View History

2026-06-11 15:46:19 +08:00
package main
import (
2026-06-17 08:05:20 +08:00
"context"
2026-06-11 15:46:19 +08:00
"embed"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
)
//go:embed all:frontend/dist
var assets embed.FS
func main() {
app := NewApp()
2026-06-17 08:05:20 +08:00
fileHandler := NewFileHandler()
2026-06-11 15:46:19 +08:00
err := wails.Run(&options.App{
2026-06-17 08:05:20 +08:00
Title: "XK 文件工具箱",
Width: 1280,
Height: 860,
2026-06-11 15:46:19 +08:00
AssetServer: &assetserver.Options{
Assets: assets,
},
2026-06-17 08:05:20 +08:00
BackgroundColour: &options.RGBA{R: 13, G: 17, B: 23, A: 1},
OnStartup: func(ctx context.Context) {
app.startup(ctx)
fileHandler.startup(ctx)
},
2026-06-11 15:46:19 +08:00
Bind: []interface{}{
app,
2026-06-17 08:05:20 +08:00
fileHandler,
2026-06-11 15:46:19 +08:00
},
})
if err != nil {
println("Error:", err.Error())
}
}