├── .DS_Store
├── .vscode
└── settings.json
├── 01 HelloSciter
├── 01_HelloSciter
├── main.go
├── main.html
└── sciter-osx-64.dylib
├── 02 HelloTIScript
├── main.go
└── main.html
├── 03 TIScriptInput
├── main.go
└── main.html
├── 04 CallGoFunctionFromTIscript
├── main-update.html
├── main.go
└── main.html
├── 05 Calc[EndOfPart1]
├── main-update.html
├── main.go
└── main.html
├── 06 BuiltinHtmlIntro
├── .DS_Store
├── main.go
└── sciter.png
├── 07 notepadScratch
├── 07-notepadScratch.exe
├── main.go
├── notepad.html
└── packfolder.exe
├── 08 packfolderIntro
├── main.go
├── packfolder.exe
├── res.go
└── res
│ ├── htdocs
│ └── notepad.htm
│ └── styles
│ └── style.css
├── 09 image-viewer
├── image-viewer.png
├── image1.png
├── imageViewer.exe
├── main.go
├── packfolder.exe
├── res.go
├── res
│ ├── fonts
│ │ ├── fa-version.txt
│ │ ├── font-awesome.inc.htm
│ │ ├── fontawesome-as-inline-images.htm
│ │ ├── fontawesome-webfont.ttf
│ │ ├── test-classic-fa-usage.htm
│ │ └── test-fontawesome.htm
│ ├── htdocs
│ │ └── image-viewer.htm
│ └── styles
│ │ └── style.css
└── sciter.png
├── 10 screen-selfi
├── 58c39b14-8eb5-457f-8bc5-504cb35bb3bb.png
├── main.exe
├── main.go
├── packfolder.exe
├── res.go
├── res
│ ├── htdocs
│ │ ├── main.htm
│ │ └── screen.htm
│ └── styles
│ │ └── style.css
└── selfi-sefli.png
├── 11 custome-layout
├── main.go
├── packfolder.exe
├── res.go
├── res
│ ├── fonts
│ │ ├── fa-version.txt
│ │ ├── font-awesome.inc.htm
│ │ ├── fontawesome-as-inline-images.htm
│ │ ├── fontawesome-webfont.ttf
│ │ ├── test-classic-fa-usage.htm
│ │ └── test-fontawesome.htm
│ ├── htdocs
│ │ └── main.html
│ └── styles
│ │ └── style.css
└── selfi-sefli.png
├── 12 sciter glassy background
├── .DS_Store
├── .vscode
│ └── settings.json
├── Screenshot 2020-04-11 at 1.42.16 PM.png
├── go.mod
├── go.sum
├── index.html
├── main.go
├── sciter
├── sciter-osx-64.dylib
├── script.tis
└── style.css
├── 13 sciter window-frame-extend
├── .DS_Store
├── .vscode
│ └── settings.json
├── cover-Pic.png
├── evil-big-smile-emoji-739736.png
├── go.mod
├── go.sum
├── index.html
├── main.go
├── sciter
├── sciter-osx-64.dylib
├── script.tis
└── style.css
├── 13.1 sciter window-frame-solid
├── .DS_Store
├── .vscode
│ └── settings.json
├── cover-Pic.png
├── evil-big-smile-emoji-739736.png
├── go.mod
├── go.sum
├── index.html
├── main.go
├── sciter
├── sciter-osx-64.dylib
├── script.tis
└── style.css
├── 14 Add button with on click event binding from go to sciter
├── .DS_Store
├── .vscode
│ └── settings.json
├── go.mod
├── go.sum
├── index.html
├── main.go
├── script.tis
└── style.css
├── 15 Create new window on button click
├── .DS_Store
├── .vscode
│ └── settings.json
├── child.html
├── go.mod
├── go.sum
├── index.html
└── main.go
├── 16 Add Menu in menubar in MacOS
├── .DS_Store
├── .vscode
│ └── settings.json
├── cgo_code.sample
├── go.mod
├── go.sum
├── index.html
└── main.go
├── _config.yml
├── master
├── main.go
└── main.html
├── readme.md
└── xx-MultiPage
├── 07-MultiPage.exe
├── controller.go
├── main.go
├── pages.go
└── sciter.png
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/.DS_Store
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | }
--------------------------------------------------------------------------------
/01 HelloSciter/01_HelloSciter:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/01 HelloSciter/01_HelloSciter
--------------------------------------------------------------------------------
/01 HelloSciter/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 |
6 | "github.com/sciter-sdk/go-sciter"
7 | "github.com/sciter-sdk/go-sciter/window"
8 | )
9 |
10 | func main() {
11 |
12 | rect := sciter.NewRect(100, 100, 600, 400)
13 | window, windowCreationErr := window.New(sciter.SW_MAIN|sciter.SW_TITLEBAR|sciter.SW_ENABLE_DEBUG, rect)
14 |
15 | if windowCreationErr != nil {
16 | fmt.Errorf("Could not create sciter window : %s",
17 | windowCreationErr.Error())
18 | return
19 | }
20 |
21 | uiFileLoadErr := window.LoadFile("./main.html")
22 | if uiFileLoadErr != nil {
23 | fmt.Errorf("Could not load ui file : %s",
24 | uiFileLoadErr.Error())
25 | }
26 |
27 | window.SetTitle("Hello")
28 | window.Show()
29 | window.Run()
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/01 HelloSciter/main.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 | Instead of loading full FontAwesome in memory you can use Sciter's inline vector images.
16 |
9 |
Content should go below
10 |
11 |
12 | X
13 |
14 |
15 |
16 |
17 |
50 |
--------------------------------------------------------------------------------
/10 screen-selfi/res/styles/style.css:
--------------------------------------------------------------------------------
1 | html
2 | {
3 | font:system;
4 | background:transparent;
5 | overflow: hidden;
6 | }
7 |
8 | body{
9 | background: rgba(200, 200, 200, 0.5);
10 | overflow: hidden;
11 | }
12 |
13 | .navi{
14 | width: 100%;
15 | background: #cfcfcf;
16 | display: flex
17 | }
18 |
19 | .btn{
20 | display: inline-block;
21 | padding: 30px;
22 | width: *;
23 | }
--------------------------------------------------------------------------------
/10 screen-selfi/selfi-sefli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/10 screen-selfi/selfi-sefli.png
--------------------------------------------------------------------------------
/11 custome-layout/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "syscall"
5 |
6 | "github.com/sciter-sdk/go-sciter"
7 | "github.com/sciter-sdk/go-sciter/window"
8 | )
9 |
10 | func main() {
11 | // make rect for window
12 | rect := sciter.NewRect(100, 100, 800, 200)
13 |
14 | // create a window using upper rect
15 | win, _ := window.New(sciter.SW_MAIN|sciter.SW_CONTROLS|
16 | sciter.SW_ENABLE_DEBUG, rect)
17 |
18 | win.SetTitle("custom-screen")
19 |
20 |
21 | win.SetResourceArchive(resources)
22 | win.LoadFile("this://app/htdocs/main.html")
23 |
24 | win.Show()
25 | win.Run()
26 | win.CloseArchive()
27 | }
28 |
29 | func closeApplication(vals ...*sciter.Value) *sciter.Value {
30 | syscall.Exit(0)
31 | return nil
32 | }
33 |
--------------------------------------------------------------------------------
/11 custome-layout/packfolder.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/11 custome-layout/packfolder.exe
--------------------------------------------------------------------------------
/11 custome-layout/res/fonts/fa-version.txt:
--------------------------------------------------------------------------------
1 | Font Awesome
2 | Version 4.7.0
3 | http://fontawesome.io/
--------------------------------------------------------------------------------
/11 custome-layout/res/fonts/font-awesome.inc.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
--------------------------------------------------------------------------------
/11 custome-layout/res/fonts/fontawesome-as-inline-images.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
14 |
15 |
Instead of loading full FontAwesome in memory you can use Sciter's inline vector images.
16 |
Steps to convert FontAwesome icons to inline vectors:
17 |
18 | - Grab needed icon from one of normalized FontAwesome SVG files from here: https://github.com/encharm/Font-Awesome-SVG-PNG/tree/master/black/svg
19 | - Copy content of <path d="..."> from the file.
20 | - Add "path:" in front of it.
21 | - And use it as a URL in <img src="..."> or back/foreground-image: url(...);
22 |
23 |
24 |
25 | Examples:
26 |
30 |
ambulance.svg
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/11 custome-layout/res/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/11 custome-layout/res/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/11 custome-layout/res/fonts/test-classic-fa-usage.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
24 |
25 |
26 |
27 |
fa-camera-retro
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/11 custome-layout/res/htdocs/main.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Sciter Graphics.Text
4 |
56 |
91 |
92 |
93 |
Click on block to transform
94 |
Hello World!
95 |
مرحبا العالم!
96 |
שלום עולם!
97 |
Привет, Мир!
98 |
您好,世界!
99 |
こんにちは、世界!
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/11 custome-layout/res/styles/style.css:
--------------------------------------------------------------------------------
1 |
2 | @font-face {
3 | font-family: MyAwesome;
4 | src: url(../fonts/fontawesome-webfont.ttf);
5 | }
6 |
7 |
8 | html
9 | {
10 | font:system;
11 | background:transparent;
12 | overflow: hidden;
13 | border: 1px solid #cfcfcc;
14 | }
15 |
16 |
17 | .title-bar{
18 | position: absolute;
19 | top: 0;
20 | left: 0;
21 | width: *;
22 | background: rgba(100, 100, 100, 0.8);
23 | font-size:12dip;
24 | padding:0dip 15dip;
25 | }
26 |
27 | .title-bar > .left{
28 | float: left;
29 | padding: 0;
30 | margin: 0;
31 | }
32 |
33 | .title-bar > .right{
34 | float: right;
35 | padding: 0;
36 | margin: 0;
37 | }
38 |
39 | .fa {
40 | font: 19dip MyAwesome;
41 | padding:0;
42 | margin:0;
43 | }
--------------------------------------------------------------------------------
/11 custome-layout/selfi-sefli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/11 custome-layout/selfi-sefli.png
--------------------------------------------------------------------------------
/12 sciter glassy background/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/12 sciter glassy background/.DS_Store
--------------------------------------------------------------------------------
/12 sciter glassy background/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.fontSize": 14,
3 | "editor.lineHeight": 22
4 | }
--------------------------------------------------------------------------------
/12 sciter glassy background/Screenshot 2020-04-11 at 1.42.16 PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/12 sciter glassy background/Screenshot 2020-04-11 at 1.42.16 PM.png
--------------------------------------------------------------------------------
/12 sciter glassy background/go.mod:
--------------------------------------------------------------------------------
1 | module Tutorials/sciter
2 |
3 | go 1.13
4 |
5 | require (
6 | github.com/boltdb/bolt v1.3.1
7 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 // indirect
8 | github.com/sciter-sdk/go-sciter v0.5.0
9 | go.etcd.io/bbolt v1.3.3
10 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d // indirect
11 | )
12 |
--------------------------------------------------------------------------------
/12 sciter glassy background/go.sum:
--------------------------------------------------------------------------------
1 | github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
2 | github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
3 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 h1:5BmtGkQbch91lglMHQ9JIDGiYCL3kBRBA0ItZTvOcEI=
4 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4/go.mod h1:ouWl4wViUNh8tPSIwxTVMuS014WakR1hqvBc2I0bMoA=
5 | github.com/sciter-sdk/go-sciter v0.5.0 h1:A0gESvTFZR/yMFkWnQ4tFVUdsSchuShNGr25QodE8gQ=
6 | github.com/sciter-sdk/go-sciter v0.5.0/go.mod h1:myhbEunWE4R+6J7GxJsr4SU4q0OIMOEbWFJ2qYzIdPc=
7 | go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
8 | go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
9 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0=
10 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
11 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA=
12 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
13 |
--------------------------------------------------------------------------------
/12 sciter glassy background/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
28 |
29 |
30 |
31 |
32 |
36 |
37 |
This is workspace
38 |
Looks Nice!
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/12 sciter glassy background/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/sciter-sdk/go-sciter"
5 | "github.com/sciter-sdk/go-sciter/window"
6 | )
7 |
8 | func main() {
9 |
10 | // create rect for window
11 | rect := sciter.NewRect(200, 200, 400, 100)
12 |
13 | // create scister window object with rect
14 | win, _ := window.New(sciter.SW_MAIN|sciter.SW_GLASSY, rect)
15 |
16 | // set title for window
17 | win.SetTitle("Load HTML Page as UI")
18 |
19 | // load index.html file in window
20 | win.LoadFile("./index.html")
21 |
22 | // Launch sciter window
23 | win.Show()
24 |
25 | // run sciter application
26 | win.Run()
27 | }
28 |
--------------------------------------------------------------------------------
/12 sciter glassy background/sciter:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/12 sciter glassy background/sciter
--------------------------------------------------------------------------------
/12 sciter glassy background/sciter-osx-64.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/12 sciter glassy background/sciter-osx-64.dylib
--------------------------------------------------------------------------------
/12 sciter glassy background/script.tis:
--------------------------------------------------------------------------------
1 | /* We will handle button clicks in script.tis
2 | [ here ] */
3 |
4 | var turns = 0
5 |
6 | // Handle click event of button
7 | event click $(button){
8 | // we have to chage text value of button
9 | // on click of that button
10 |
11 | // here game is two player game
12 | // so we can use %2 operation to define
13 | // whose turn is
14 |
15 |
16 | // one more condition
17 | // "Same button can not clicked twice"
18 | // lets make some decoration
19 |
20 | // once button is clicked it should be disabled
21 |
22 | if(this.text == ""){
23 | if(turns%2){
24 | this.text = "X" // here this means button that
25 | // has been clicked
26 | }else{
27 | this.text = "Y"
28 | }
29 | this.state.disabled = true;
30 | turns++;
31 | }
32 | }
--------------------------------------------------------------------------------
/12 sciter glassy background/style.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/12 sciter glassy background/style.css
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/13 sciter window-frame-extend/.DS_Store
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.fontSize": 14,
3 | "editor.lineHeight": 22
4 | }
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/cover-Pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/13 sciter window-frame-extend/cover-Pic.png
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/evil-big-smile-emoji-739736.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/13 sciter window-frame-extend/evil-big-smile-emoji-739736.png
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/go.mod:
--------------------------------------------------------------------------------
1 | module Tutorials/sciter
2 |
3 | go 1.13
4 |
5 | require (
6 | github.com/boltdb/bolt v1.3.1
7 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 // indirect
8 | github.com/sciter-sdk/go-sciter v0.5.0
9 | go.etcd.io/bbolt v1.3.3
10 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d // indirect
11 | )
12 |
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/go.sum:
--------------------------------------------------------------------------------
1 | github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
2 | github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
3 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 h1:5BmtGkQbch91lglMHQ9JIDGiYCL3kBRBA0ItZTvOcEI=
4 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4/go.mod h1:ouWl4wViUNh8tPSIwxTVMuS014WakR1hqvBc2I0bMoA=
5 | github.com/sciter-sdk/go-sciter v0.5.0 h1:A0gESvTFZR/yMFkWnQ4tFVUdsSchuShNGr25QodE8gQ=
6 | github.com/sciter-sdk/go-sciter v0.5.0/go.mod h1:myhbEunWE4R+6J7GxJsr4SU4q0OIMOEbWFJ2qYzIdPc=
7 | go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
8 | go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
9 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0=
10 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
11 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA=
12 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
13 |
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/index.html:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
23 |
24 |
25 |
26 |
30 |
31 |
32 |

33 |
Hi
34 |
35 |
36 |
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/sciter-sdk/go-sciter"
5 | "github.com/sciter-sdk/go-sciter/window"
6 | )
7 |
8 | func main() {
9 |
10 | // create rect for window
11 | rect := sciter.NewRect(200, 200, 800, 600)
12 |
13 | // create scister window object with rect
14 | win, _ := window.New(sciter.SW_MAIN, rect)
15 |
16 | // set title for window
17 | // win.SetTitle("Load HTML Page as UI")
18 |
19 | // load index.html file in window
20 | win.LoadFile("./index.html")
21 |
22 | // Launch sciter window
23 | win.Show()
24 |
25 | // run sciter application
26 | win.Run()
27 | }
28 |
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/sciter:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/13 sciter window-frame-extend/sciter
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/sciter-osx-64.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/13 sciter window-frame-extend/sciter-osx-64.dylib
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/script.tis:
--------------------------------------------------------------------------------
1 | /* We will handle button clicks in script.tis
2 | [ here ] */
3 |
4 | var turns = 0
5 |
6 | // Handle click event of button
7 | event click $(button){
8 | // we have to chage text value of button
9 | // on click of that button
10 |
11 | // here game is two player game
12 | // so we can use %2 operation to define
13 | // whose turn is
14 |
15 |
16 | // one more condition
17 | // "Same button can not clicked twice"
18 | // lets make some decoration
19 |
20 | // once button is clicked it should be disabled
21 |
22 | if(this.text == ""){
23 | if(turns%2){
24 | this.text = "X" // here this means button that
25 | // has been clicked
26 | }else{
27 | this.text = "Y"
28 | }
29 | this.state.disabled = true;
30 | turns++;
31 | }
32 | }
--------------------------------------------------------------------------------
/13 sciter window-frame-extend/style.css:
--------------------------------------------------------------------------------
1 | body{
2 | border: 2px solid #cfcfcf;
3 | }
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/13.1 sciter window-frame-solid/.DS_Store
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.fontSize": 14,
3 | "editor.lineHeight": 22
4 | }
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/cover-Pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/13.1 sciter window-frame-solid/cover-Pic.png
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/evil-big-smile-emoji-739736.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/13.1 sciter window-frame-solid/evil-big-smile-emoji-739736.png
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/go.mod:
--------------------------------------------------------------------------------
1 | module Tutorials/sciter
2 |
3 | go 1.13
4 |
5 | require (
6 | github.com/boltdb/bolt v1.3.1
7 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 // indirect
8 | github.com/sciter-sdk/go-sciter v0.5.0
9 | go.etcd.io/bbolt v1.3.3
10 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d // indirect
11 | )
12 |
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/go.sum:
--------------------------------------------------------------------------------
1 | github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
2 | github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
3 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 h1:5BmtGkQbch91lglMHQ9JIDGiYCL3kBRBA0ItZTvOcEI=
4 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4/go.mod h1:ouWl4wViUNh8tPSIwxTVMuS014WakR1hqvBc2I0bMoA=
5 | github.com/sciter-sdk/go-sciter v0.5.0 h1:A0gESvTFZR/yMFkWnQ4tFVUdsSchuShNGr25QodE8gQ=
6 | github.com/sciter-sdk/go-sciter v0.5.0/go.mod h1:myhbEunWE4R+6J7GxJsr4SU4q0OIMOEbWFJ2qYzIdPc=
7 | go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
8 | go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
9 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0=
10 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
11 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA=
12 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
13 |
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/index.html:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
23 |
24 |
25 |
26 |
27 | Limitless Possiblities
28 |
29 |
30 |
31 |
32 |
33 |

34 |
Hi
35 |
36 |
37 |
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/sciter-sdk/go-sciter"
5 | "github.com/sciter-sdk/go-sciter/window"
6 | )
7 |
8 | func main() {
9 |
10 | // create rect for window
11 | rect := sciter.NewRect(200, 200, 800, 600)
12 |
13 | // create scister window object with rect
14 | win, _ := window.New(sciter.SW_MAIN|sciter.SW_TOOL|sciter.SW_TITLEBAR, rect)
15 |
16 | // set title for window
17 | // win.SetTitle("Load HTML Page as UI")
18 |
19 | // load index.html file in window
20 | win.LoadFile("./index.html")
21 |
22 | // Launch sciter window
23 | win.Show()
24 |
25 | // run sciter application
26 | win.Run()
27 | }
28 |
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/sciter:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/13.1 sciter window-frame-solid/sciter
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/sciter-osx-64.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/13.1 sciter window-frame-solid/sciter-osx-64.dylib
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/script.tis:
--------------------------------------------------------------------------------
1 | /* We will handle button clicks in script.tis
2 | [ here ] */
3 |
4 | var turns = 0
5 |
6 | // Handle click event of button
7 | event click $(button){
8 | // we have to chage text value of button
9 | // on click of that button
10 |
11 | // here game is two player game
12 | // so we can use %2 operation to define
13 | // whose turn is
14 |
15 |
16 | // one more condition
17 | // "Same button can not clicked twice"
18 | // lets make some decoration
19 |
20 | // once button is clicked it should be disabled
21 |
22 | if(this.text == ""){
23 | if(turns%2){
24 | this.text = "X" // here this means button that
25 | // has been clicked
26 | }else{
27 | this.text = "Y"
28 | }
29 | this.state.disabled = true;
30 | turns++;
31 | }
32 | }
--------------------------------------------------------------------------------
/13.1 sciter window-frame-solid/style.css:
--------------------------------------------------------------------------------
1 | body{
2 | border: 2px solid #cfcfcf;
3 | }
--------------------------------------------------------------------------------
/14 Add button with on click event binding from go to sciter/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/14 Add button with on click event binding from go to sciter/.DS_Store
--------------------------------------------------------------------------------
/14 Add button with on click event binding from go to sciter/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.fontSize": 14,
3 | "editor.lineHeight": 22
4 | }
--------------------------------------------------------------------------------
/14 Add button with on click event binding from go to sciter/go.mod:
--------------------------------------------------------------------------------
1 | module Tutorials/sciter
2 |
3 | go 1.13
4 |
5 | require (
6 | github.com/boltdb/bolt v1.3.1
7 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 // indirect
8 | github.com/sciter-sdk/go-sciter v0.5.0
9 | go.etcd.io/bbolt v1.3.3
10 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d // indirect
11 | )
12 |
--------------------------------------------------------------------------------
/14 Add button with on click event binding from go to sciter/go.sum:
--------------------------------------------------------------------------------
1 | github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
2 | github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
3 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 h1:5BmtGkQbch91lglMHQ9JIDGiYCL3kBRBA0ItZTvOcEI=
4 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4/go.mod h1:ouWl4wViUNh8tPSIwxTVMuS014WakR1hqvBc2I0bMoA=
5 | github.com/sciter-sdk/go-sciter v0.5.0 h1:A0gESvTFZR/yMFkWnQ4tFVUdsSchuShNGr25QodE8gQ=
6 | github.com/sciter-sdk/go-sciter v0.5.0/go.mod h1:myhbEunWE4R+6J7GxJsr4SU4q0OIMOEbWFJ2qYzIdPc=
7 | go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
8 | go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
9 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0=
10 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
11 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA=
12 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
13 |
--------------------------------------------------------------------------------
/14 Add button with on click event binding from go to sciter/index.html:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
17 |
18 |
19 |
20 |
21 |
1. Add button from Go
22 |
2. On button click open new window
23 |
24 |
25 |
--------------------------------------------------------------------------------
/14 Add button with on click event binding from go to sciter/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/sciter-sdk/go-sciter"
5 | "github.com/sciter-sdk/go-sciter/window"
6 | )
7 |
8 | func main() {
9 |
10 | // create rect for window
11 | rect := sciter.NewRect(200, 200, 800, 600)
12 |
13 | // create scister window object with rect
14 | win, _ := window.New(sciter.SW_MAIN, rect)
15 |
16 | // load index.html file in window
17 | win.LoadFile("./index.html")
18 |
19 | // Add button from go...
20 |
21 | // 1. Select root element of window
22 | rootEl, _ := win.GetRootElement()
23 |
24 | // 1.1 select button-spot div
25 | buttonspotEl, _ := rootEl.SelectById("button-spot")
26 |
27 | // 2. Preapre button element
28 | buttonEl, _ := sciter.CreateElement("button", "Click me button")
29 |
30 | // 3. Append button to button-spot element
31 | buttonspotEl.Append(buttonEl)
32 |
33 | // 4. Add onclick event for button
34 | buttonEl.OnClick(func() {
35 | buttonEl.SetText("You clicked me")
36 | })
37 |
38 | // Launch sciter window
39 | win.Show()
40 | // run sciter application
41 | win.Run()
42 | }
43 |
--------------------------------------------------------------------------------
/14 Add button with on click event binding from go to sciter/script.tis:
--------------------------------------------------------------------------------
1 | /* We will handle button clicks in script.tis
2 | [ here ] */
3 |
4 | var turns = 0
5 |
6 | // Handle click event of button
7 | event click $(button){
8 | // we have to chage text value of button
9 | // on click of that button
10 |
11 | // here game is two player game
12 | // so we can use %2 operation to define
13 | // whose turn is
14 |
15 |
16 | // one more condition
17 | // "Same button can not clicked twice"
18 | // lets make some decoration
19 |
20 | // once button is clicked it should be disabled
21 |
22 | if(this.text == ""){
23 | if(turns%2){
24 | this.text = "X" // here this means button that
25 | // has been clicked
26 | }else{
27 | this.text = "Y"
28 | }
29 | this.state.disabled = true;
30 | turns++;
31 | }
32 | }
--------------------------------------------------------------------------------
/14 Add button with on click event binding from go to sciter/style.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/14 Add button with on click event binding from go to sciter/style.css
--------------------------------------------------------------------------------
/15 Create new window on button click/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/15 Create new window on button click/.DS_Store
--------------------------------------------------------------------------------
/15 Create new window on button click/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.fontSize": 14,
3 | "editor.lineHeight": 22
4 | }
--------------------------------------------------------------------------------
/15 Create new window on button click/child.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Child window
4 |
5 |
--------------------------------------------------------------------------------
/15 Create new window on button click/go.mod:
--------------------------------------------------------------------------------
1 | module Tutorials/sciter
2 |
3 | go 1.13
4 |
5 | require (
6 | github.com/boltdb/bolt v1.3.1
7 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 // indirect
8 | github.com/sciter-sdk/go-sciter v0.5.0
9 | go.etcd.io/bbolt v1.3.3
10 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d // indirect
11 | )
12 |
--------------------------------------------------------------------------------
/15 Create new window on button click/go.sum:
--------------------------------------------------------------------------------
1 | github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
2 | github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
3 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 h1:5BmtGkQbch91lglMHQ9JIDGiYCL3kBRBA0ItZTvOcEI=
4 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4/go.mod h1:ouWl4wViUNh8tPSIwxTVMuS014WakR1hqvBc2I0bMoA=
5 | github.com/sciter-sdk/go-sciter v0.5.0 h1:A0gESvTFZR/yMFkWnQ4tFVUdsSchuShNGr25QodE8gQ=
6 | github.com/sciter-sdk/go-sciter v0.5.0/go.mod h1:myhbEunWE4R+6J7GxJsr4SU4q0OIMOEbWFJ2qYzIdPc=
7 | go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
8 | go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
9 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0=
10 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
11 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA=
12 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
13 |
--------------------------------------------------------------------------------
/15 Create new window on button click/index.html:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
17 |
18 |
19 |
20 |
21 |
1. Add button from Go
22 |
2. On button click open new window
23 |
24 |
25 |
--------------------------------------------------------------------------------
/15 Create new window on button click/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/sciter-sdk/go-sciter"
5 | "github.com/sciter-sdk/go-sciter/window"
6 | )
7 |
8 | func main() {
9 |
10 | // create rect for window
11 | rect := sciter.NewRect(200, 200, 800, 600)
12 |
13 | // create scister window object with rect
14 | win, _ := window.New(sciter.SW_MAIN, rect)
15 |
16 | // load index.html file in window
17 | win.LoadFile("./index.html")
18 |
19 | // Add button from go...
20 |
21 | // 1. Select root element of window
22 | rootEl, _ := win.GetRootElement()
23 |
24 | // 1.1 select button-spot div
25 | buttonspotEl, _ := rootEl.SelectById("button-spot")
26 |
27 | // 2. Preapre button element
28 | buttonEl, _ := sciter.CreateElement("button", "Click me button")
29 |
30 | // 3. Append button to button-spot element
31 | buttonspotEl.Append(buttonEl)
32 |
33 | // 4. Add onclick event for button
34 | buttonEl.OnClick(func() {
35 | child_window, _ := window.New(sciter.SW_POPUP|sciter.SW_TITLEBAR, nil)
36 | child_window.SetTitle("Child window")
37 | child_window.LoadFile("./child.html")
38 | child_window.Show()
39 | })
40 |
41 | // Launch sciter window
42 | win.Show()
43 | // run sciter application
44 | win.Run()
45 | }
46 |
--------------------------------------------------------------------------------
/16 Add Menu in menubar in MacOS /.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/16 Add Menu in menubar in MacOS /.DS_Store
--------------------------------------------------------------------------------
/16 Add Menu in menubar in MacOS /.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.fontSize": 14,
3 | "editor.lineHeight": 22
4 | }
--------------------------------------------------------------------------------
/16 Add Menu in menubar in MacOS /cgo_code.sample:
--------------------------------------------------------------------------------
1 | /*
2 | #cgo CFLAGS: -x objective-c
3 | #cgo LDFLAGS: -framework Cocoa
4 | #import
5 |
6 |
7 | int LoadMenu(void) {
8 | [NSAutoreleasePool new];
9 | [NSApplication sharedApplication];
10 | [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
11 | id menubar = [[NSMenu new] autorelease];
12 | id appMenuItem = [[NSMenuItem new] autorelease];
13 | [menubar addItem:appMenuItem];
14 | [NSApp setMainMenu:menubar];
15 | id appMenu = [[NSMenu new] autorelease];
16 | id appName = [[NSProcessInfo processInfo] processName];
17 | id quitTitle = [@"Quit " stringByAppendingString:appName];
18 | id quitMenuItem = [[[NSMenuItem alloc] initWithTitle:quitTitle
19 | action:@selector(terminate:) keyEquivalent:@"q"]
20 | autorelease];
21 |
22 | [appMenu addItem:[[[NSMenuItem alloc] initWithTitle:@"CoolDude" action:@selector(caller:) keyEquivalent:@""] autorelease] ];
23 | [appMenu addItem:quitMenuItem];
24 |
25 | [appMenuItem setSubmenu:appMenu];
26 |
27 | return 0;
28 | }
29 | */
30 | import "C"
31 |
32 |
33 | // add this code to main function
34 |
35 | C.LoadMenu()
--------------------------------------------------------------------------------
/16 Add Menu in menubar in MacOS /go.mod:
--------------------------------------------------------------------------------
1 | module Tutorials/sciter
2 |
3 | go 1.13
4 |
5 | require (
6 | github.com/boltdb/bolt v1.3.1
7 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 // indirect
8 | github.com/sciter-sdk/go-sciter v0.5.0
9 | go.etcd.io/bbolt v1.3.3
10 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d // indirect
11 | )
12 |
--------------------------------------------------------------------------------
/16 Add Menu in menubar in MacOS /go.sum:
--------------------------------------------------------------------------------
1 | github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
2 | github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
3 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 h1:5BmtGkQbch91lglMHQ9JIDGiYCL3kBRBA0ItZTvOcEI=
4 | github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4/go.mod h1:ouWl4wViUNh8tPSIwxTVMuS014WakR1hqvBc2I0bMoA=
5 | github.com/sciter-sdk/go-sciter v0.5.0 h1:A0gESvTFZR/yMFkWnQ4tFVUdsSchuShNGr25QodE8gQ=
6 | github.com/sciter-sdk/go-sciter v0.5.0/go.mod h1:myhbEunWE4R+6J7GxJsr4SU4q0OIMOEbWFJ2qYzIdPc=
7 | go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
8 | go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
9 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0=
10 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
11 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA=
12 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
13 |
--------------------------------------------------------------------------------
/16 Add Menu in menubar in MacOS /index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |