Cosmetic changes

This commit is contained in:
Lea Anthony 2020-11-17 21:44:48 +11:00
commit ca4e2b2391
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405
2 changed files with 12 additions and 3 deletions

View file

@ -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())
}

View file

@ -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