Go language using Go-sciter to create desktop apps (vi) Element elements operation and event response

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.