mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 17:39:58 +08:00
36 lines
694 B
Go
36 lines
694 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/wailsapp/wails/v2"
|
|
)
|
|
|
|
// Basic application struct
|
|
type Basic struct {
|
|
runtime *wails.Runtime
|
|
}
|
|
|
|
// newBasic creates a new Basic application struct
|
|
func newBasic() *Basic {
|
|
return &Basic{}
|
|
}
|
|
|
|
// WailsInit is called at application startup
|
|
func (b *Basic) WailsInit(runtime *wails.Runtime) error {
|
|
// Perform your setup here
|
|
b.runtime = runtime
|
|
runtime.Window.SetTitle("minmax")
|
|
return nil
|
|
}
|
|
|
|
// WailsShutdown is called at application termination
|
|
func (b *Basic) WailsShutdown() {
|
|
// Perform your teardown here
|
|
}
|
|
|
|
// Greet returns a greeting for the given name
|
|
func (b *Basic) Greet(name string) string {
|
|
return fmt.Sprintf("Hello %s!", name)
|
|
}
|