mirror of
https://github.com/taigrr/wails.git
synced 2026-04-17 04:05:12 -07:00
Merge commit '25a157e6614739fbd4df1da3d11d46afe72ae9a8' as 'v2'
This commit is contained in:
43
v2/test/runtime/main.go
Normal file
43
v2/test/runtime/main.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
wails "github.com/leaanthony/wailsv2/v2"
|
||||
)
|
||||
|
||||
type Echo struct {
|
||||
}
|
||||
|
||||
func (e *Echo) Echo(message string) string {
|
||||
return message
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
// Create application with options
|
||||
app := wails.CreateAppWithOptions(&wails.Options{
|
||||
Title: "Runtime Tester!",
|
||||
Width: 850,
|
||||
Height: 620,
|
||||
DisableResize: false,
|
||||
Fullscreen: false,
|
||||
})
|
||||
|
||||
// You can also use the simplified call:
|
||||
// app := wails.CreateApp("Tester!", 1024, 768)
|
||||
|
||||
// ------------- Assets ------------
|
||||
// assets := wails.Assets()
|
||||
|
||||
// textFile, err := assets.Read("hello.txt")
|
||||
// if err != nil {
|
||||
// println("Unable to load asset: hello.txt")
|
||||
// }
|
||||
// println(textFile)
|
||||
// ---------------------------------
|
||||
|
||||
app.Bind(newCalc("te"))
|
||||
app.Bind(&Echo{})
|
||||
app.Bind(&RuntimeTest{})
|
||||
|
||||
app.Run()
|
||||
}
|
||||
Reference in New Issue
Block a user