For a detailed documentation, see the following two links:
Https://sciter.com/docs/content/sciter/Element.htmhttps://sciter.com/docs/content/sciter/Event.htm
The demo8.html code is as follows:
<! DOCTYPE html>Because Tiscript is used in HTML, debugging can only be done with the debugging tools that are available in SCITER-SDK if you want to debug.
Under SCITER-SDK, find the two files of Bin\64\sciter.exe and Inspector.exe, copy to the location you specified, and note that the two files should be put together.
Double-click Open Sciter.exe File
Note that only static pages can be debugged, and the methods and functions defined in go cannot be invoked.
Knowing the element operation and event handling above, we'll simply write a small example:
The demo7.html code is as follows:
<! DOCTYPE html>The Demo7.go code is as follows:
Package Main;import ("Github.com/sciter-sdk/go-sciter/window" "Github.com/sciter-sdk/go-sciter" "Log" "FMT") func Deffunc (w *window. Window) {//Register dump function for easy printing of data w in tis script. Definefunction ("Dump", func (args ... *sciter). Value) *sciter. Value {for _, V: = Range args {fmt. Print (v.string () + "");} Fmt. Println (); return sciter. Nullvalue ();}); /Register Reg function, used to process the registration logic, here is simply to print out the data W. Definefunction ("Reg", func (args ... *sciter). Value) *sciter. Value {for _, V: = Range args {fmt. Print (v.string () + "");} Fmt. Println (); return sciter. Nullvalue ();});} Func Main () {W, Err: = window. New (Sciter. Defaultwindowcreateflag, Sciter. Defaultrect); if err! = Nil {log. Fatal (err);} W.loadfile ("demo7.html"); W.settitle ("Tiscript script Learning");d Effunc (w); W.show (); W.run ();}
The results of the operation are as follows:
With the JSON data passed into the front-end UI, the backend go can parse the JSON to handle it, such as in MySQL database and so on.
Go language using Go-sciter to create desktop apps (vi) Element elements operation and event response