func main() { flag.Parse() if len(flag.Args()) < 1 { log.Fatal("no html file found") } // create window w, err := window.New(sciter.DefaultWindowCreaetFlag, sciter.DefaultRect) if err != nil { log.Fatal(err) } log.Printf("Sciter Version: %X %X\n", sciter.Version(true), sciter.Version(false)) // resource packing rice.HandleDataLoad(w.Sciter) // enable debug ok := w.SetOption(sciter.SCITER_SET_DEBUG_MODE, 1) if !ok { log.Println("set debug mode failed") } // load file if err = w.LoadFile(flag.Arg(0)); err != nil { log.Println("LoadFile error:", err.Error()) return } root, err := w.GetRootElement() if err != nil { log.Fatalf("get root element failed: %s", err.Error()) } setElementHandlers(root) // set handlers setEventHandler(w) setCallbackHandlers(w) testCall(w) w.Show() w.Run() }
func main() { flag.Parse() log.Println(flag.Arg(0)) w, err := window.New(sciter.SW_ENABLE_DEBUG|sciter.SW_GLASSY, sciter.DefaultRect) if err != nil { log.Fatal(err) } w.SetTitle("Download Element Content") w.LoadHtml("<html><body><span id='url'>Url To Load</span><div id='content'></div></body></html>", "/") test() load(w, flag.Arg(0)) w.Show() w.Run() }