First off, thank you for the time Jan. Secondly, as far as my knowledge goes:
- your example is declaring the function in place, it doesn't pass the variable around to another function, i.e. goConect - my code evolved , so now, if I use a init func then it's off to init passing the w to main Using var w at a package level is now solving all these problems. Is there any other way? Thanks. type conectare struct { Utilizator string `json:"utilizator"` Parola string `json:"parola"` Bazadate string `json:"bazadate"` } func init() { w, err := window.New(sciter.DefaultWindowCreateFlag, sciter.DefaultRect) if err != nil { log.Fatal(err) } } func main() { c := conectare{} w.SetResourceArchive(resources) w.LoadFile("this://app/conect.html") w.DefineFunction("goConect", func(vals ...*sciter.Value) *sciter.Value { json.Unmarshal([]byte(vals[0].String()), &c) w.LoadFile("this://app/cauta.html") return nil }) w.Show() w.Run() } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.