mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 07:29:56 +08:00

* [v3 example] HTML dnd API test * Update v3/examples/html-dnd-api/main.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * docs: add entry to changelog --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
41 lines
856 B
Go
41 lines
856 B
Go
package main
|
|
|
|
import (
|
|
"embed"
|
|
"log"
|
|
|
|
"github.com/wailsapp/wails/v3/pkg/application"
|
|
)
|
|
|
|
//go:embed assets
|
|
var assets embed.FS
|
|
|
|
func main() {
|
|
|
|
app := application.New(application.Options{
|
|
Name: "HTML Drag and Drop API Demo",
|
|
Description: "A demo of the HTML Drag and drop API",
|
|
Assets: application.AssetOptions{
|
|
Handler: application.BundledAssetFileServer(assets),
|
|
},
|
|
Mac: application.MacOptions{
|
|
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
|
},
|
|
})
|
|
|
|
app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
|
Title: "Drag-n-drop Demo",
|
|
Mac: application.MacWindow{
|
|
Backdrop: application.MacBackdropTranslucent,
|
|
TitleBar: application.MacTitleBarHiddenInsetUnified,
|
|
InvisibleTitleBarHeight: 50,
|
|
},
|
|
})
|
|
|
|
err := app.Run()
|
|
|
|
if err != nil {
|
|
log.Fatal(err.Error())
|
|
}
|
|
}
|