mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Cosmetic changes
This commit is contained in:
parent
630abbd3c8
commit
ca4e2b2391
2 changed files with 12 additions and 3 deletions
|
|
@ -2,13 +2,13 @@ package main
|
|||
|
||||
import (
|
||||
wails "github.com/wailsapp/wails/v2"
|
||||
"github.com/wailsapp/wails/v2/internal/runtime"
|
||||
)
|
||||
|
||||
type MyStruct struct {
|
||||
runtime *wails.Runtime
|
||||
}
|
||||
|
||||
// ShowPlatformHelp shows specific help for the platform
|
||||
func (l *MyStruct) ShowPlatformHelp() {
|
||||
l.runtime.Browser.Open("https://wails.app/gettingstarted/" + runtime.System.Platform())
|
||||
l.runtime.Browser.Open("https://wails.app/gettingstarted/" + l.runtime.System.Platform())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,26 @@
|
|||
package main
|
||||
|
||||
import wails "github.com/wailsapp/wails/v2"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
wails "github.com/wailsapp/wails/v2"
|
||||
)
|
||||
|
||||
type MyStruct struct {
|
||||
runtime *wails.Runtime
|
||||
}
|
||||
|
||||
type Notes struct {
|
||||
lines []string
|
||||
}
|
||||
|
||||
func (m *MyStruct) WailsInit(runtime *wails.Runtime) error {
|
||||
|
||||
runtime.Events.On("notes updated", func(optionalData ...interface{}) {
|
||||
// Get notes
|
||||
notes := optionalData[0].(*Notes)
|
||||
// Save the notes to disk
|
||||
fmt.Printf("%+v\n", notes)
|
||||
})
|
||||
|
||||
m.runtime = runtime
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue