├── .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 |

Hello Sciter

13 | 14 | 15 | -------------------------------------------------------------------------------- /01 HelloSciter/sciter-osx-64.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/01 HelloSciter/sciter-osx-64.dylib -------------------------------------------------------------------------------- /02 HelloTIScript/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, 300, 300) 13 | window, windowCreationErr := window.New(sciter.SW_MAIN|sciter.SW_CONTROLS|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 | // Setting up stage for Harmony 28 | window.SetTitle("Simple Input") 29 | window.Show() 30 | window.Run() 31 | 32 | } 33 | -------------------------------------------------------------------------------- /02 HelloTIScript/main.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 7 | 8 | 9 |

Press Button

10 | 11 | 17 | 18 | -------------------------------------------------------------------------------- /03 TIScriptInput/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/fatih/color" 5 | "github.com/sciter-sdk/go-sciter" 6 | "github.com/sciter-sdk/go-sciter/window" 7 | ) 8 | 9 | func main() { 10 | 11 | rect := sciter.NewRect(100, 100, 300, 300) 12 | window, windowCreationErr := window.New(sciter.SW_MAIN|sciter.SW_CONTROLS|sciter.SW_ENABLE_DEBUG, rect) 13 | 14 | if windowCreationErr != nil { 15 | // fmt.L("Failed to generate sciter window ", windowCreationErr.Error()) 16 | } 17 | 18 | uiLoadingError := window.LoadFile("./main.html") 19 | if uiLoadingError != nil { 20 | color.RedString("Failed to load ui file ", uiLoadingError.Error()) 21 | } 22 | 23 | // Setting up stage for Harmony 24 | window.SetTitle("Simple Input") 25 | window.Show() 26 | window.Run() 27 | 28 | } 29 | -------------------------------------------------------------------------------- /03 TIScriptInput/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 |

Simple Input

8 | 9 |
10 | 11 | 12 | 13 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /04 CallGoFunctionFromTIscript/main-update.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 8 | 9 | 10 |

Simple Input

11 | 12 | 13 | 16 | 22 | 23 | 24 | 27 | 30 | 31 | 32 | 35 | 38 | 39 | 40 | 41 | 42 |
14 | 15 | 17 | 20 | 21 |
25 | 26 | 28 | 29 |
33 | 34 | 36 | 37 |
43 | 44 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /04 CallGoFunctionFromTIscript/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/fatih/color" 7 | "github.com/sciter-sdk/go-sciter" 8 | "github.com/sciter-sdk/go-sciter/window" 9 | ) 10 | 11 | func main() { 12 | 13 | rect := sciter.NewRect(100, 100, 300, 300) 14 | window, windowsGenerateionError := window.New(sciter.SW_MAIN|sciter.SW_CONTROLS|sciter.SW_ENABLE_DEBUG, rect) 15 | 16 | if windowsGenerateionError != nil { 17 | color.RedString("Failed to generate sciter window ", windowsGenerateionError.Error()) 18 | } 19 | 20 | uiLoadingError := window.LoadFile("./main-update.html") 21 | if uiLoadingError != nil { 22 | color.RedString("Failed to load ui file ", uiLoadingError.Error()) 23 | } 24 | 25 | window.DefineFunction("Sum", Sum) 26 | 27 | // Setting up stage for Harmony 28 | window.SetTitle("Simple Input") 29 | window.Show() 30 | window.Run() 31 | 32 | } 33 | 34 | // Sum function we want to call on the input 35 | // from TIScript 36 | func Sum(vals ...*sciter.Value) *sciter.Value { 37 | sumval := 0 38 | for _, val := range vals { 39 | sumval += val.Int() 40 | fmt.Println(val.Int()) 41 | } 42 | fmt.Println("summation is ", sumval) 43 | // sumString := fmt.Sprintf("%v", sumval) 44 | 45 | return sciter.NewValue(sumval) 46 | } 47 | -------------------------------------------------------------------------------- /04 CallGoFunctionFromTIscript/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 |

Simple Input

8 | 9 | 10 | 11 | 14 | 17 | 18 | 19 | 22 | 25 | 26 | 27 | 30 | 33 | 34 | 35 | 36 | 37 |
12 | 13 | 15 | 16 |
20 | 21 | 23 | 24 |
28 | 29 | 31 | 32 |
38 | 39 | 40 | 41 | 42 | 48 | 49 | -------------------------------------------------------------------------------- /05 Calc[EndOfPart1]/main-update.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 26 | 27 | 28 |

Simple Input

29 | 30 | 31 | 32 | 0 33 | 1 34 | 2 35 | 3 36 | 4 37 | 5 38 | 6 39 | 7 40 | 8 41 | 9 42 | + 43 | - 44 | * 45 | / 46 | = 47 | 48 | 49 |

Operator Found

50 | 51 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /05 Calc[EndOfPart1]/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | "strings" 7 | 8 | "github.com/fatih/color" 9 | "github.com/sciter-sdk/go-sciter" 10 | "github.com/sciter-sdk/go-sciter/window" 11 | ) 12 | 13 | func main() { 14 | 15 | rect := sciter.NewRect(100, 100, 300, 300) 16 | window, windowsGenerateionError := window.New(sciter.SW_MAIN|sciter.SW_CONTROLS|sciter.SW_ENABLE_DEBUG, rect) 17 | 18 | if windowsGenerateionError != nil { 19 | color.RedString("Failed to generate sciter window ", windowsGenerateionError.Error()) 20 | } 21 | 22 | uiLoadingError := window.LoadFile("./main-update.html") 23 | if uiLoadingError != nil { 24 | color.RedString("Failed to load ui file ", uiLoadingError.Error()) 25 | } 26 | 27 | window.DefineFunction("Operate", Operate) 28 | 29 | // Setting up stage for Harmony 30 | window.SetTitle("Simple Input") 31 | window.Show() 32 | window.Run() 33 | 34 | } 35 | 36 | // Operate function just expects one parametre 37 | // mathamatic string containing both 38 | // operands and operator 39 | func Operate(val ...*sciter.Value) *sciter.Value { 40 | 41 | // Trim All space as we are taking 42 | // now input as string 43 | trimmedString := val[0].String() 44 | 45 | // if input empty or not 46 | if strings.TrimSpace(trimmedString) == "" { 47 | fmt.Println("Invalid input ") 48 | return nil 49 | } 50 | 51 | opGroup := []string{"+", "-", "*", "/"} 52 | 53 | for _, op := range opGroup { 54 | if strings.Contains(trimmedString, op) { 55 | fmt.Println("we found ", op, " operator in string") 56 | inputString := strings.Split(trimmedString, op) 57 | op1, _ := strconv.Atoi(inputString[0]) 58 | op2, _ := strconv.Atoi(inputString[1]) 59 | switch op { 60 | case "+": 61 | { 62 | return sciter.NewValue(op1 + op2) 63 | } 64 | case "-": 65 | { 66 | return sciter.NewValue(op1 - op2) 67 | } 68 | case "/": 69 | { 70 | return sciter.NewValue(op1 / op2) 71 | } 72 | case "*": 73 | { 74 | return sciter.NewValue(op1 * op2) 75 | } 76 | default: 77 | { 78 | fmt.Println("Awesome !!! , but ... no operator found ") 79 | } 80 | } 81 | } 82 | 83 | } 84 | return nil 85 | } 86 | -------------------------------------------------------------------------------- /05 Calc[EndOfPart1]/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 |

Simple Input

8 | 9 | 10 | 13 | 14 | 15 | 18 | 21 | 24 | 27 | 28 | 29 | 32 | 35 | 38 | 41 | 42 | 43 | 46 | 49 | 52 | 55 | 56 | 57 | 58 | 59 | 60 | 63 | 64 |
11 | 12 |
16 | 17 | 19 | 20 | 22 | 23 | 25 | 26 |
30 | 31 | 33 | 34 | 36 | 37 | 39 | 40 |
44 | 45 | 47 | 48 | 50 | 51 | 53 | 54 |
0 61 | 62 |
65 |

Previous Press

66 | 67 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /06 BuiltinHtmlIntro/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/06 BuiltinHtmlIntro/.DS_Store -------------------------------------------------------------------------------- /06 BuiltinHtmlIntro/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 | // Creating A Reactangle of size we want 13 | rect := sciter.NewRect(200, 200, 400, 400) 14 | // Create Window Over The rect 15 | appWindow, windowErr := window.New(sciter.SW_MAIN|sciter.SW_CONTROLS| 16 | sciter.SW_ENABLE_DEBUG, rect) 17 | // If we cannot create window 18 | // Application execution has to be stopped 19 | // Because app has been failed in its first most stage 20 | if windowErr != nil { 21 | fmt.Errorf("Failed to create application window due to %s ", windowErr.Error()) 22 | return 23 | } 24 | uiLoadErr := appWindow.LoadHtml(screens(), "/") 25 | if uiLoadErr != nil { 26 | fmt.Errorf("Failed to Load UI dur to %s ", uiLoadErr.Error()) 27 | return 28 | } 29 | appWindow.SetTitle("Score") 30 | // Showing window on screen 31 | appWindow.Show() 32 | // Making window Running ... 33 | appWindow.Run() 34 | 35 | } 36 | 37 | func screens() string { 38 | return ` 39 | 40 | 41 | 42 | 43 |

No Html Files Need Any More

44 | 45 | 46 |
47 | 48 | 49 | 54 | 55 | ` 56 | } 57 | -------------------------------------------------------------------------------- /06 BuiltinHtmlIntro/sciter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/06 BuiltinHtmlIntro/sciter.png -------------------------------------------------------------------------------- /07 notepadScratch/07-notepadScratch.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/07 notepadScratch/07-notepadScratch.exe -------------------------------------------------------------------------------- /07 notepadScratch/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "os" 7 | "strings" 8 | "syscall" 9 | 10 | "github.com/sciter-sdk/go-sciter" 11 | "github.com/sciter-sdk/go-sciter/window" 12 | ) 13 | 14 | func main() { 15 | // make rect for window 16 | rect := sciter.NewRect(100, 100, 300, 500) 17 | 18 | // create a window using upper rect 19 | win, _ := window.New(sciter.SW_MAIN|sciter.SW_CONTROLS|sciter.SW_ENABLE_DEBUG, rect) 20 | win.LoadFile("./notepad.html") 21 | win.SetTitle("Notepad+-") 22 | 23 | // registering methods 24 | win.DefineFunction("closeWindow", closeApplication) 25 | win.DefineFunction("save", save) 26 | win.DefineFunction("open", open) 27 | 28 | win.Show() 29 | win.Run() 30 | } 31 | 32 | func closeApplication(vals ...*sciter.Value) *sciter.Value { 33 | syscall.Exit(0) 34 | return nil 35 | } 36 | 37 | func save(vals ...*sciter.Value) *sciter.Value { 38 | 39 | fmt.Println("Saving Your Document") 40 | path := vals[0] 41 | doc := vals[1] 42 | 43 | processedFilePath := strings.Replace(path.String(), "file://", "", 1) 44 | file, fileCreationError := os.OpenFile(processedFilePath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.ModePerm) 45 | 46 | if fileCreationError != nil { 47 | fmt.Println("failed to create a blank file ", fileCreationError.Error()) 48 | return nil 49 | } 50 | 51 | defer file.Close() 52 | 53 | charCount, writeError := file.WriteString(doc.String()) 54 | if writeError != nil { 55 | fmt.Println("failed to write on file due to : ", writeError.Error()) 56 | return nil 57 | } 58 | fmt.Println("chars written ", charCount) 59 | fmt.Println("we got path as ", path.String()) 60 | return nil 61 | } 62 | 63 | func open(vals ...*sciter.Value) *sciter.Value { 64 | fmt.Println("Saving Your Document") 65 | path := vals[0] 66 | processedFilePath := strings.Replace(path.String(), "file://", "", 1) 67 | 68 | readBytes, readError := ioutil.ReadFile(processedFilePath) 69 | 70 | if readError != nil { 71 | fmt.Println("failed to write on file due to : ", readError.Error()) 72 | return nil 73 | } 74 | fmt.Println("chars written ", len(readBytes)) 75 | fmt.Println("we got path as ", path.String()) 76 | return sciter.NewValue(string(readBytes)) 77 | } 78 | -------------------------------------------------------------------------------- /07 notepadScratch/notepad.html: -------------------------------------------------------------------------------- 1 | 2 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
68 | 79 |
80 | 81 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /07 notepadScratch/packfolder.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/07 notepadScratch/packfolder.exe -------------------------------------------------------------------------------- /08 packfolderIntro/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "os" 7 | "strings" 8 | "syscall" 9 | 10 | "github.com/sciter-sdk/go-sciter" 11 | "github.com/sciter-sdk/go-sciter/window" 12 | ) 13 | 14 | func main() { 15 | // make rect for window 16 | rect := sciter.NewRect(100, 100, 300, 500) 17 | 18 | // create a window using upper rect 19 | win, _ := window.New(sciter.SW_MAIN|sciter.SW_CONTROLS|sciter.SW_RESIZEABLE, rect) 20 | 21 | win.SetResourceArchive(resources) 22 | win.LoadFile("this://app/htdocs/notepad.htm") 23 | 24 | win.SetTitle("Notepad+-") 25 | 26 | // registering methods 27 | win.DefineFunction("closeWindow", closeApplication) 28 | win.DefineFunction("save", save) 29 | win.DefineFunction("open", open) 30 | 31 | win.Show() 32 | win.Run() 33 | win.CloseArchive() 34 | } 35 | 36 | func closeApplication(vals ...*sciter.Value) *sciter.Value { 37 | syscall.Exit(0) 38 | return nil 39 | } 40 | 41 | func save(vals ...*sciter.Value) *sciter.Value { 42 | 43 | fmt.Println("Saving Your Document") 44 | path := vals[0] 45 | doc := vals[1] 46 | 47 | processedFilePath := strings.Replace(path.String(), "file://", "", 1) 48 | file, fileCreationError := os.OpenFile(processedFilePath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.ModePerm) 49 | 50 | if fileCreationError != nil { 51 | fmt.Println("failed to create a blank file ", fileCreationError.Error()) 52 | return nil 53 | } 54 | 55 | defer file.Close() 56 | 57 | charCount, writeError := file.WriteString(doc.String()) 58 | if writeError != nil { 59 | fmt.Println("failed to write on file due to : ", writeError.Error()) 60 | return nil 61 | } 62 | fmt.Println("chars written ", charCount) 63 | fmt.Println("we got path as ", path.String()) 64 | return nil 65 | } 66 | 67 | func open(vals ...*sciter.Value) *sciter.Value { 68 | fmt.Println("Saving Your Document") 69 | path := vals[0] 70 | processedFilePath := strings.Replace(path.String(), "file://", "", 1) 71 | readBytes, readError := ioutil.ReadFile(processedFilePath) 72 | if readError != nil { 73 | fmt.Println("failed to write on file due to : ", readError.Error()) 74 | return nil 75 | } 76 | fmt.Println("chars written ", len(readBytes)) 77 | fmt.Println("we got path as ", path.String()) 78 | return sciter.NewValue(string(readBytes)) 79 | } 80 | -------------------------------------------------------------------------------- /08 packfolderIntro/packfolder.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/08 packfolderIntro/packfolder.exe -------------------------------------------------------------------------------- /08 packfolderIntro/res.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | var resources []byte = []byte { 4 | 0x53,0x41,0x72,0x00,0x24,0x00,0x00,0x00,0x68,0x00,0xff,0xff,0x01,0x00,0x13,0x00,0x74,0x00,0xff,0xff,0x02,0x00,0xff,0xff,0x64,0x00,0xff,0xff,0x03,0x00,0xff,0xff,0x6f,0x00,0xff,0xff,0x04,0x00,0xff,0xff,0x63, 5 | 0x00,0xff,0xff,0x05,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x06,0x00,0xff,0xff,0x2f,0x00,0xff,0xff,0x07,0x00,0xff,0xff,0x6e,0x00,0xff,0xff,0x08,0x00,0xff,0xff,0x6f,0x00,0xff,0xff,0x09,0x00,0xff,0xff,0x74,0x00, 6 | 0xff,0xff,0x0a,0x00,0xff,0xff,0x65,0x00,0xff,0xff,0x0b,0x00,0xff,0xff,0x70,0x00,0xff,0xff,0x0c,0x00,0xff,0xff,0x61,0x00,0xff,0xff,0x0d,0x00,0xff,0xff,0x64,0x00,0xff,0xff,0x0e,0x00,0xff,0xff,0x2e,0x00,0xff, 7 | 0xff,0x0f,0x00,0xff,0xff,0x68,0x00,0xff,0xff,0x10,0x00,0xff,0xff,0x74,0x00,0xff,0xff,0x11,0x00,0xff,0xff,0x6d,0x00,0xff,0xff,0x12,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x01,0x00,0xff,0xff,0x73,0x00,0xff,0xff, 8 | 0x14,0x00,0xff,0xff,0x74,0x00,0xff,0xff,0x15,0x00,0xff,0xff,0x79,0x00,0xff,0xff,0x16,0x00,0xff,0xff,0x6c,0x00,0xff,0xff,0x17,0x00,0xff,0xff,0x65,0x00,0xff,0xff,0x18,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x19, 9 | 0x00,0xff,0xff,0x2f,0x00,0xff,0xff,0x1a,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x1b,0x00,0xff,0xff,0x74,0x00,0xff,0xff,0x1c,0x00,0xff,0xff,0x79,0x00,0xff,0xff,0x1d,0x00,0xff,0xff,0x6c,0x00,0xff,0xff,0x1e,0x00, 10 | 0xff,0xff,0x65,0x00,0xff,0xff,0x1f,0x00,0xff,0xff,0x2e,0x00,0xff,0xff,0x20,0x00,0xff,0xff,0x63,0x00,0xff,0xff,0x21,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x22,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x23,0x00,0xff, 11 | 0xff,0x00,0x00,0xff,0xff,0x02,0x00,0xff,0xff,0x02,0x00,0x00,0x00,0x44,0x01,0x00,0x00,0x3b,0x03,0x00,0x00,0x35,0x07,0x00,0x00,0x7f,0x04,0x00,0x00,0x9a,0x02,0x00,0x00,0x4e,0x05,0x00,0x00,0x08,0x3c,0x68,0x74, 12 | 0x6d,0x6c,0x3e,0x0d,0x0a,0x20,0x20,0x00,0x04,0x3c,0x68,0x65,0x61,0x64,0xa0,0x0b,0x40,0x00,0x05,0x3c,0x73,0x74,0x79,0x6c,0x65,0xe0,0x02,0x10,0x40,0x00,0x0e,0x40,0x69,0x6d,0x70,0x6f,0x72,0x74,0x20,0x75,0x72, 13 | 0x6c,0x28,0x2e,0x2e,0x2f,0x60,0x22,0x00,0x73,0x80,0x06,0x05,0x2e,0x63,0x73,0x73,0x29,0x3b,0xe0,0x01,0x2e,0x00,0x3c,0x80,0x16,0xa0,0x40,0x01,0x3c,0x2f,0xe0,0x02,0x5e,0x05,0x3c,0x62,0x6f,0x64,0x79,0x3e,0x20, 14 | 0x08,0xe0,0x03,0x00,0x80,0x1a,0x40,0x00,0x1f,0x3c,0x21,0x2d,0x2d,0x20,0x54,0x65,0x78,0x74,0x61,0x72,0x65,0x61,0x20,0x74,0x6f,0x20,0x67,0x65,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x20,0x66,0x72,0x6f,0x6d,0x20, 15 | 0x05,0x75,0x73,0x65,0x72,0x2d,0x2d,0xa0,0x4b,0x40,0x00,0x01,0x3c,0x74,0xc0,0x2c,0x0c,0x63,0x6f,0x6c,0x73,0x3d,0x22,0x33,0x32,0x22,0x20,0x72,0x6f,0x77,0x20,0x09,0x07,0x32,0x34,0x22,0x20,0x23,0x64,0x61,0x74, 16 | 0x20,0x19,0x02,0x6c,0x61,0x73,0x20,0x10,0xc0,0x29,0x03,0x22,0x3e,0x3c,0x2f,0xc0,0x0b,0xe0,0x00,0x89,0x01,0x0d,0x0a,0xe0,0x02,0x53,0x40,0x84,0x1e,0x53,0x69,0x6d,0x75,0x6c,0x61,0x74,0x69,0x6e,0x67,0x20,0x4d, 17 | 0x65,0x6e,0x75,0x62,0x61,0x72,0x20,0x66,0x6f,0x72,0x20,0x6e,0x6f,0x74,0x65,0x70,0x61,0x64,0x20,0xe0,0x05,0x84,0x02,0x64,0x69,0x76,0xe0,0x00,0x65,0x03,0x6f,0x70,0x2d,0x6d,0x20,0x30,0x00,0x22,0xe0,0x00,0x5a, 18 | 0x40,0x00,0xe0,0x01,0x2b,0x40,0x00,0x02,0x3c,0x75,0x6c,0xc0,0x2e,0x40,0x2a,0x20,0x5b,0x00,0x22,0xe0,0x02,0x4d,0xc0,0x00,0x02,0x3c,0x6c,0x69,0xe0,0x0a,0x15,0x40,0x00,0x03,0x46,0x69,0x6c,0x65,0xe0,0x0d,0x19, 19 | 0xe0,0x02,0x59,0x02,0x73,0x75,0x62,0xa0,0x88,0xe0,0x0d,0x2a,0x40,0x00,0x20,0x62,0x0a,0x20,0x23,0x6e,0x65,0x77,0x3e,0x4e,0x65,0x77,0x3c,0x2f,0xe0,0x10,0x6f,0x40,0x00,0x60,0x2a,0x05,0x6f,0x70,0x65,0x6e,0x3e, 20 | 0x4f,0x20,0x04,0xe0,0x1b,0x2c,0x05,0x73,0x61,0x76,0x65,0x3e,0x53,0x20,0x04,0xe0,0x1b,0x2c,0x05,0x65,0x78,0x69,0x74,0x3e,0x45,0x20,0x04,0xe0,0x12,0x2c,0x02,0x3c,0x2f,0x75,0xc2,0xb1,0xe0,0x03,0x00,0x60,0x31, 21 | 0x20,0x07,0xe0,0x00,0x00,0xe0,0x09,0x22,0xe0,0x05,0x11,0xe0,0x06,0x47,0x01,0x3c,0x2f,0x21,0xbe,0x40,0x40,0xe2,0x04,0x03,0x0a,0x73,0x63,0x72,0x69,0x70,0x74,0x20,0x74,0x79,0x70,0x65,0x21,0xd4,0x22,0x2e,0x02, 22 | 0x2f,0x74,0x69,0x80,0x13,0xe1,0x03,0x50,0xe0,0x01,0x09,0x40,0x00,0x04,0x65,0x76,0x65,0x6e,0x74,0x21,0x7f,0x05,0x69,0x63,0x6b,0x20,0x24,0x28,0x60,0xd3,0x01,0x29,0x7b,0xe0,0x05,0x22,0x40,0x00,0x11,0x76,0x69, 23 | 0x65,0x77,0x2e,0x63,0x6c,0x6f,0x73,0x65,0x57,0x69,0x6e,0x64,0x6f,0x77,0x28,0x29,0xe0,0x05,0x23,0x00,0x7d,0xe0,0x01,0x0e,0xe0,0x01,0x09,0x40,0x00,0xe0,0x06,0x5f,0x41,0x8d,0xe0,0x0b,0x5f,0x14,0x63,0x6f,0x6e, 24 | 0x73,0x74,0x20,0x48,0x54,0x4d,0x4c,0x5f,0x46,0x49,0x4c,0x45,0x53,0x20,0x3d,0x20,0x22,0x4e,0xa2,0xb7,0x07,0x50,0x6c,0x75,0x73,0x20,0x4d,0x69,0x6e,0x20,0x05,0x08,0x28,0x2a,0x2e,0x6e,0x70,0x70,0x6d,0x29,0x7c, 25 | 0x80,0x07,0x01,0x22,0x3b,0x20,0x3a,0xe0,0x06,0x70,0x40,0x00,0x00,0x76,0x42,0xf9,0x22,0x70,0x03,0x70,0x61,0x74,0x68,0x20,0x49,0x60,0xbc,0x05,0x73,0x65,0x6c,0x65,0x63,0x74,0x42,0x86,0x80,0x85,0x00,0x2c,0xe0, 26 | 0x03,0x6d,0x0a,0x2c,0x20,0x22,0x55,0x6e,0x6e,0x61,0x6d,0x65,0x64,0x22,0x20,0x0a,0x40,0x3a,0x40,0x07,0x40,0x2c,0x00,0x20,0x40,0x15,0x43,0xd5,0x42,0x1a,0x01,0x3a,0x22,0xe4,0x03,0x32,0xc0,0x00,0x01,0x2f,0x2f, 27 | 0x23,0xee,0x07,0x63,0x61,0x73,0x65,0x20,0x6f,0x66,0x20,0x60,0x77,0x03,0x20,0x77,0x61,0x73,0x43,0x76,0x00,0x20,0x80,0x74,0x06,0x65,0x64,0x20,0x74,0x68,0x65,0x6e,0xe0,0x0c,0x39,0x0e,0x66,0x75,0x6e,0x63,0x74, 28 | 0x69,0x6f,0x6e,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x36,0x02,0x75,0x6c,0x6c,0xe0,0x09,0x29,0x03,0x69,0x66,0x20,0x28,0x40,0x59,0x40,0xd1,0xe1,0x0b,0x3f,0x40,0x00,0x20,0x6c,0x00,0x66,0x64,0x3d,0x00,0x2e, 29 | 0x41,0xfb,0xc0,0xf7,0x40,0xeb,0xe0,0x01,0x3a,0xe1,0x0b,0x2d,0xe1,0x02,0xbb,0x40,0x00,0x20,0x0e,0xe0,0x05,0x10,0xe1,0x06,0xc2,0x41,0x08,0xe0,0x0b,0x82,0xe1,0x33,0xc2,0xe0,0x01,0x00,0xe0,0x09,0x57,0xe1,0x17, 30 | 0xcc,0x40,0x8f,0xe1,0x41,0xcc,0x80,0x5e,0x20,0x1e,0xe1,0x00,0x33,0x00,0x2c,0x20,0x6c,0xe1,0x02,0x57,0x21,0x42,0xe0,0x00,0x00,0xe0,0x05,0x3e,0x21,0x38,0x20,0x05,0x60,0x00,0xe0,0x01,0x09,0x40,0x00,0xe1,0x06, 31 | 0x40,0x24,0xbc,0xe1,0x0b,0x3f,0xe0,0x05,0x66,0x20,0xe9,0x01,0x22,0x22,0xe0,0x05,0x24,0xe0,0x0c,0x5f,0x01,0x3c,0x2f,0x83,0xe1,0x23,0xe0,0x80,0x14,0x01,0x3c,0x2f,0x66,0xae,0x01,0x0d,0x0a,0x26,0xc3,0x03,0x74, 32 | 0x6d,0x6c,0x3e,0x04,0x2a,0x7b,0x0d,0x0a,0x20,0x20,0x00,0x0a,0x70,0x61,0x64,0x64,0x69,0x6e,0x67,0x3a,0x20,0x30,0x3b,0x80,0x10,0x05,0x6d,0x61,0x72,0x67,0x69,0x6e,0x80,0x0f,0x0d,0x7d,0x0d,0x0a,0x0d,0x0a,0x2e, 33 | 0x74,0x6f,0x70,0x2d,0x6d,0x65,0x6e,0x75,0xc0,0x31,0x05,0x6f,0x73,0x69,0x74,0x69,0x6f,0x20,0x22,0x07,0x61,0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x20,0x29,0x20,0x17,0x0b,0x20,0x77,0x69,0x64,0x74,0x68,0x3a,0x20, 34 | 0x31,0x30,0x30,0x25,0xa0,0x11,0x20,0x39,0x80,0x48,0x20,0x0b,0x04,0x20,0x6c,0x65,0x66,0x74,0xe0,0x01,0x0d,0xe0,0x17,0x77,0x02,0x75,0x6c,0x2e,0x40,0x73,0x02,0x62,0x61,0x72,0xa0,0x76,0xa0,0x5d,0xe0,0x03,0x5e, 35 | 0x14,0x62,0x61,0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x2d,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x23,0x63,0x60,0x00,0x00,0x3b,0x20,0x1d,0xe0,0x00,0x00,0x80,0x2c,0xe0,0x01,0x70,0x04,0x20,0x20,0x34,0x70, 36 | 0x78,0x40,0x21,0x80,0x18,0xe0,0x01,0x78,0x20,0x0c,0x60,0x00,0xe0,0x06,0x80,0x05,0x20,0x3e,0x20,0x6c,0x69,0x20,0xa0,0x86,0x14,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x3a,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x2d, 37 | 0x62,0x6c,0x6f,0x63,0x6b,0xa0,0x8f,0x60,0x84,0x20,0x83,0x00,0x36,0x60,0x00,0xa0,0x14,0xe0,0x02,0x77,0x00,0x35,0xe0,0x0c,0x76,0xe0,0x05,0x16,0xe1,0x01,0x5d,0x06,0x72,0x65,0x6c,0x61,0x74,0x69,0x76,0x41,0x5d, 38 | 0xe0,0x09,0x8e,0x05,0x3a,0x68,0x6f,0x76,0x65,0x72,0xc0,0x94,0xc0,0x78,0x20,0xf9,0x20,0x00,0x20,0x30,0x20,0x13,0xe1,0x02,0x1d,0x20,0x19,0x20,0x8f,0x20,0x00,0x40,0x66,0xe0,0x0d,0x00,0x20,0x63,0x60,0x05,0x20, 39 | 0x66,0x02,0x73,0x75,0x62,0x61,0xee,0xc0,0x5c,0xe0,0x01,0x91,0xe1,0x06,0xef,0xe1,0x00,0x0a,0x02,0x6e,0x6f,0x6e,0xc0,0x13,0x61,0xf1,0x04,0x31,0x36,0x64,0x69,0x70,0xa0,0x10,0xe1,0x05,0xf5,0xa1,0xc4,0x03,0x61, 40 | 0x75,0x74,0x6f,0xa0,0x11,0x04,0x68,0x65,0x69,0x67,0x68,0x20,0x21,0xe0,0x02,0x12,0x09,0x6c,0x69,0x73,0x74,0x2d,0x73,0x74,0x79,0x6c,0x65,0xe0,0x04,0x5a,0xe1,0x00,0x30,0xa0,0x0f,0xe1,0x01,0x58,0xa0,0x10,0x09, 41 | 0x62,0x6f,0x78,0x2d,0x73,0x68,0x61,0x64,0x6f,0x77,0x22,0x26,0x00,0x32,0x20,0x82,0xe0,0x02,0x04,0x04,0x72,0x67,0x62,0x61,0x28,0x22,0x3a,0x00,0x2c,0xc0,0x03,0x03,0x30,0x2e,0x36,0x29,0x80,0xf4,0xe0,0x07,0xf6, 42 | 0x41,0x5e,0xe0,0x00,0xfb,0xc0,0x63,0x40,0x44,0xe0,0x00,0x66,0x0a,0x72,0x64,0x65,0x72,0x2d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x40,0x69,0x03,0x70,0x78,0x20,0x64,0x20,0x0c,0x01,0x65,0x64,0xe1,0x06,0x80,0xc1,0x95, 43 | 0x00,0x33,0x60,0x00,0x20,0x14,0xe1,0x10,0xc6,0x01,0x3e,0x20,0x20,0x17,0xe0,0x00,0x80,0x00,0x7b,0x20,0x3b,0xe0,0x0e,0x00,0x80,0x58,0xc1,0x78,0xe2,0x03,0x7b,0xe1,0x04,0xed,0x02,0x66,0x66,0x66,0xe1,0x03,0xea, 44 | 0x20,0x79,0x20,0x05,0x40,0x07,0x0c,0x74,0x65,0x78,0x74,0x61,0x72,0x65,0x61,0x23,0x64,0x61,0x74,0x61,0x20,0x67,0x80,0x3b,0xe1,0x19,0xe1,0xe0,0x03,0x69,0x41,0xe2,0xe1,0x08,0xe1,0x00,0x30,0x40,0x0f,0x20,0x0c, 45 | 0x20,0x00,0x80,0x15,0xa1,0xe9,0x21,0x6a,0xc3,0xad,0x02,0x66,0x6f,0x6e,0x21,0xd6,0x01,0x69,0x7a,0x21,0xd5,0x01,0x31,0x34,0xe0,0x00,0x2e,0x80,0x1b,0xe0,0x01,0xbd,0x04,0x2d,0x69,0x6d,0x61,0x67,0x20,0x22,0xe1, 46 | 0x03,0xf9,0xe0,0x02,0x1d,0x81,0x53,0x07,0x23,0x61,0x34,0x61,0x66,0x61,0x33,0x3b,0xa0,0x3d,0xa0,0x14,0x05,0x32,0x39,0x32,0x31,0x32,0x31,0xc0,0x33,0x61,0xa5,0xa2,0x40,0x20,0x0f,0xc0,0x00,0x80,0x1d,0x41,0x75, 47 | 0x07,0x66,0x6c,0x6f,0x77,0x2d,0x77,0x72,0x61,0x22,0xb0,0x00,0x62,0x21,0x12,0x02,0x6b,0x2d,0x77,0x20,0x32,0xa0,0x3d,0xe0,0x00,0x1f,0x20,0xfb,0xe2,0x02,0x99,0x0e,0x77,0x68,0x69,0x74,0x65,0x2d,0x73,0x70,0x61, 48 | 0x63,0x65,0x3a,0x70,0x72,0x65,0x60,0x3d,0x20,0x84,0x01,0x0a,0x7d, 49 | } 50 | -------------------------------------------------------------------------------- /08 packfolderIntro/res/htdocs/notepad.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 25 |
26 | 27 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /08 packfolderIntro/res/styles/style.css: -------------------------------------------------------------------------------- 1 | html 2 | { 3 | font:system; 4 | background:transparent; 5 | overflow:none; 6 | padding:0; 7 | transform: translate(100%,0); 8 | } 9 | 10 | body 11 | { 12 | background-clip: padding-box; 13 | padding:8dip; margin:0; 14 | border-left:1dip solid rgba(150,150,150,0.25); 15 | transform: translate(0%,0); 16 | } 17 | 18 | html[state="shown"] { 19 | transform: translate(0%,0); 20 | transition: transform(quint-out,300ms); 21 | } 22 | 23 | section { 24 | flow: grid(1 2, 25 | 3 3, 26 | 4 5); 27 | border-spacing: 8dip; 28 | } 29 | 30 | brick { 31 | display:block; 32 | width:*; 33 | height: 100dip; 34 | background: gold; 35 | } 36 | 37 | .navi{ 38 | width: 100%; 39 | background: #cfcfcf; 40 | display: flex 41 | } 42 | 43 | .btn{ 44 | display: inline-block; 45 | padding: 30px; 46 | width: *; 47 | } -------------------------------------------------------------------------------- /09 image-viewer/image-viewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/09 image-viewer/image-viewer.png -------------------------------------------------------------------------------- /09 image-viewer/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/09 image-viewer/image1.png -------------------------------------------------------------------------------- /09 image-viewer/imageViewer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/09 image-viewer/imageViewer.exe -------------------------------------------------------------------------------- /09 image-viewer/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "bytes" 6 | "encoding/base64" 7 | "fmt" 8 | "image/png" 9 | "io/ioutil" 10 | "os" 11 | "path/filepath" 12 | "strings" 13 | "sync" 14 | "syscall" 15 | 16 | "github.com/disintegration/imaging" 17 | "github.com/sciter-sdk/go-sciter" 18 | "github.com/sciter-sdk/go-sciter/window" 19 | ) 20 | 21 | var Index int // Stores current index of image 22 | var Images []string // Images stores base64 string of images 23 | var Files []os.FileInfo 24 | 25 | func main() { 26 | // make rect for window 27 | rect := sciter.NewRect(0, 0, 800, 600) 28 | 29 | // create a window using upper rect 30 | win, _ := window.New(sciter.SW_MAIN|sciter.SW_ENABLE_DEBUG, rect) 31 | 32 | win.SetTitle("ImageViewar+-") 33 | 34 | // Scanning and loading base64 of images 35 | findAndLoadImageFromCurrentDirectory() 36 | 37 | // registering methods 38 | win.DefineFunction("loadFirstImage", LoadFirstImage) 39 | win.DefineFunction("loadNextImage", LoadNextImage) 40 | win.DefineFunction("loadPreviousImage", LoadPreviousImage) 41 | // win.DefineFunction("blurCurrentImage", blurCurrentImage) 42 | win.DefineFunction("closeWindow", closeApplication) 43 | 44 | // Getting data from archive 45 | win.SetResourceArchive(resources) 46 | win.LoadFile("this://app/htdocs/image-viewer.htm") 47 | 48 | // Running app 49 | win.Show() 50 | win.Run() 51 | win.CloseArchive() 52 | } 53 | 54 | func closeApplication(vals ...*sciter.Value) *sciter.Value { 55 | syscall.Exit(0) 56 | return nil 57 | } 58 | 59 | // findAndLoadImageFromCurrentDirectory scans directory 60 | // in which exec is for jpg / png files. Reads those files 61 | // and store base64 string of those file in Images([]string) 62 | func findAndLoadImageFromCurrentDirectory() { 63 | 64 | var waitGroup sync.WaitGroup 65 | // Getting working directory 66 | thisDir, dirErr := os.Getwd() 67 | if dirErr != nil { 68 | fmt.Println("Failed to get current directory") 69 | return 70 | } 71 | files, readDirErr := ioutil.ReadDir(thisDir) 72 | if readDirErr != nil { 73 | fmt.Println("failed to read current directory") 74 | return 75 | } 76 | 77 | if len(files) > 0 { 78 | imgString := getImageString(files[0], thisDir) 79 | if imgString != "" { 80 | Images = append(Images, imgString) 81 | Files = append(Files, files[0]) 82 | } 83 | } 84 | 85 | // Loading files excpet first via goroutine 86 | // so we don't have to wait for every image 87 | // to be loaded to show up first image 88 | waitGroup.Add(1) 89 | go func() { 90 | for i, file := range files { 91 | if i == 0 { 92 | continue 93 | } 94 | imgString := getImageString(file, thisDir) 95 | if imgString != "" { 96 | Images = append(Images, imgString) 97 | Files = append(Files, file) 98 | } 99 | } 100 | waitGroup.Done() 101 | }() 102 | waitGroup.Wait() 103 | } 104 | 105 | // LoadFirstImage return first 106 | // image from Image array 107 | // to sciter 108 | func LoadFirstImage(vals ...*sciter.Value) *sciter.Value { 109 | if len(Images) > 0 { 110 | Index = 0 111 | fmt.Println("Returning first image") 112 | return sciter.NewValue(Images[0]) 113 | } 114 | return sciter.NewValue(string("-")) 115 | } 116 | 117 | // LoadNextImage return image from 118 | // next index to current index 119 | func LoadNextImage(vals ...*sciter.Value) *sciter.Value { 120 | if Index < len(Images)-1 { 121 | Index++ 122 | return sciter.NewValue(Images[Index]) 123 | } 124 | Index = 0 125 | return sciter.NewValue(Images[0]) 126 | } 127 | 128 | // LoadPreviousImage return image from 129 | // previous index to current index 130 | func LoadPreviousImage(vals ...*sciter.Value) *sciter.Value { 131 | if Index > 0 { 132 | Index-- 133 | return sciter.NewValue(Images[Index]) 134 | } 135 | Index = len(Images) - 1 136 | return sciter.NewValue(Images[0]) 137 | } 138 | 139 | func blurCurrentImage(vals ...*sciter.Value) *sciter.Value { 140 | cwd, _ := os.Getwd() 141 | imageString := Blur(Files[Index], cwd) 142 | thisString := sciter.NewValue(imageString) 143 | return thisString 144 | } 145 | 146 | // getImageString returns base64 string 147 | // of file provided as input 148 | func getImageString(file os.FileInfo, thisDir string) string { 149 | 150 | // Just supporting jpg and png file to be loaded 151 | // others are on the way .. . 152 | if strings.Contains(file.Name(), ".jpg") || strings.Contains(file.Name(), ".png") { 153 | imageFile, imageFileErr := os.Open(filepath.Join(thisDir, file.Name())) 154 | if imageFileErr != nil { 155 | fmt.Println("failed to load image file") 156 | return "" 157 | } 158 | state, stateError := imageFile.Stat() 159 | if stateError != nil { 160 | fmt.Println("failed to get state of the image file ") 161 | return "" 162 | } 163 | size := state.Size() 164 | buf := make([]byte, size) 165 | 166 | // Reading image file in buffer 167 | fReader := bufio.NewReader(imageFile) 168 | fReader.Read(buf) 169 | 170 | // Convert file to base64 171 | imgStrging := base64.StdEncoding.EncodeToString(buf) 172 | return imgStrging 173 | } 174 | return "" 175 | } 176 | 177 | func Blur(file os.FileInfo, thisDir string) string { 178 | 179 | imageFile, imageFileErr := os.Open(filepath.Join(thisDir, file.Name())) 180 | if imageFileErr != nil { 181 | fmt.Println("failed to load image file") 182 | return "" 183 | } 184 | fmt.Println("image file loaded") 185 | img, imgErr := png.Decode(imageFile) 186 | if imgErr != nil { 187 | fmt.Println("failed to decode image ", imgErr.Error()) 188 | } 189 | img2 := imaging.AdjustBrightness(img, -20) 190 | mybuffer := new(bytes.Buffer) 191 | png.Encode(mybuffer, img2) 192 | fmt.Println("blurred retured") 193 | return base64.StdEncoding.EncodeToString(mybuffer.Bytes()) 194 | 195 | } 196 | 197 | // BlurImage 198 | // func Blur(file os.FileInfo, thisDir string) string { 199 | // fmt.Println("blurring image") 200 | // imageFile, imageFileErr := os.Open(filepath.Join(thisDir, file.Name())) 201 | // if imageFileErr != nil { 202 | // fmt.Println("failed to load image file") 203 | // return "" 204 | // } 205 | // srcImage, _, err := image.Decode(imageFile) 206 | // if err != nil { 207 | // fmt.Println("failed to load decode image") 208 | // return "" 209 | // } 210 | // dstImage := imaging.Blur(srcImage, 0.5) 211 | // tempDir := os.TempDir() 212 | // name, _ := uuid.NewV4() 213 | // tempFile, errTemp := os.OpenFile(path.Join(tempDir, name.String()), 214 | // os.O_CREATE|os.O_RDWR, os.ModeTemporary) 215 | 216 | // if errTemp != nil { 217 | // fmt.Println("failed to create temp file to store image ") 218 | // return "" 219 | // } 220 | // encodingFialed := png.Encode(tempFile, dstImage) 221 | // if encodingFialed != nil { 222 | // fmt.Println("failed to encode file to return", encodingFialed.Error()) 223 | // return "" 224 | // } 225 | 226 | // state, statError := tempFile.Stat() 227 | // if statError != nil { 228 | // fmt.Println("failed to get error state ", statError.Error()) 229 | // return "" 230 | // } 231 | 232 | // size := state.Size() 233 | // buf := make([]byte, size) 234 | 235 | // // Reading image file in buffer 236 | // fReader := bufio.NewReader(imageFile) 237 | // fReader.Read(buf) 238 | // imgStrging := base64.StdEncoding.EncodeToString(buf) 239 | // fmt.Println(imgStrging) 240 | // return imgStrging 241 | // } 242 | -------------------------------------------------------------------------------- /09 image-viewer/packfolder.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/09 image-viewer/packfolder.exe -------------------------------------------------------------------------------- /09 image-viewer/res/fonts/fa-version.txt: -------------------------------------------------------------------------------- 1 | Font Awesome 2 | Version 4.7.0 3 | http://fontawesome.io/ -------------------------------------------------------------------------------- /09 image-viewer/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 | -------------------------------------------------------------------------------- /09 image-viewer/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 |
  1. Grab needed icon from one of normalized FontAwesome SVG files from here: https://github.com/encharm/Font-Awesome-SVG-PNG/tree/master/black/svg
  2. 19 |
  3. Copy content of <path d="..."> from the file.
  4. 20 |
  5. Add "path:" in front of it.
  6. 21 |
  7. And use it as a URL in <img src="..."> or back/foreground-image: url(...);
  8. 22 |
23 | 24 | 25 | Examples: 26 | 30 |

ambulance.svg 31 | 32 |

33 | 34 | 35 | -------------------------------------------------------------------------------- /09 image-viewer/res/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/09 image-viewer/res/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /09 image-viewer/res/fonts/test-classic-fa-usage.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 24 | 25 | 26 | 27 |

fa-camera-retro

28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /09 image-viewer/res/htdocs/image-viewer.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 55 | 56 | 57 | 58 | 67 |
68 | 69 |
70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /09 image-viewer/res/styles/style.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: MyAwesome; 3 | src: url(../fonts/fontawesome-webfont.ttf); 4 | } 5 | 6 | html { 7 | font: system; 8 | background: transparent; 9 | overflow: hidden; 10 | margin: 0; 11 | padding: 0; 12 | } 13 | 14 | body { 15 | background: rgba(71, 70, 70, 0.7); 16 | overflow: hidden; 17 | margin: 0; 18 | padding: 0; 19 | box-shadow: inset -12px -6px 60px -16px rgba(0,0,0,0.75); 20 | } 21 | 22 | .navi { 23 | width: 100%; 24 | background: rgba(0, 0, 0, 1); 25 | padding: 3dip 20dip; 26 | } 27 | 28 | .btn{ 29 | font: 12pt MyAwesome; 30 | border: none; 31 | border-radius: 20pt; 32 | background: transparent; 33 | color: #ffffff; 34 | } -------------------------------------------------------------------------------- /09 image-viewer/sciter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/09 image-viewer/sciter.png -------------------------------------------------------------------------------- /10 screen-selfi/58c39b14-8eb5-457f-8bc5-504cb35bb3bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/10 screen-selfi/58c39b14-8eb5-457f-8bc5-504cb35bb3bb.png -------------------------------------------------------------------------------- /10 screen-selfi/main.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/10 screen-selfi/main.exe -------------------------------------------------------------------------------- /10 screen-selfi/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "image" 6 | "image/png" 7 | "os" 8 | "syscall" 9 | 10 | "github.com/satori/go.uuid" 11 | 12 | "github.com/vova616/screenshot" 13 | 14 | "github.com/sciter-sdk/go-sciter" 15 | "github.com/sciter-sdk/go-sciter/window" 16 | ) 17 | 18 | func main() { 19 | // make rect for window 20 | rect := sciter.NewRect(0, 0, 800, 200) 21 | 22 | // create a window using upper rect 23 | win, _ := window.New(sciter.SW_MAIN|sciter.SW_CONTROLS| 24 | sciter.SW_ENABLE_DEBUG, rect) 25 | 26 | // attaching functions 27 | win.DefineFunction("snapNow", snapCalled) 28 | win.DefineFunction("closeApp", closeApplication) 29 | 30 | win.SetTitle("ScreenSefli+-") 31 | 32 | win.SetResourceArchive(resources) 33 | win.LoadFile("this://app/htdocs/main.htm") 34 | 35 | win.Show() 36 | win.Run() 37 | win.CloseArchive() 38 | } 39 | 40 | func closeApplication(vals ...*sciter.Value) *sciter.Value { 41 | syscall.Exit(0) 42 | return nil 43 | } 44 | 45 | // snapCalled is binding for sciter-Go 46 | // it calls takeASelfi function after 47 | // successfully getting required inputs 48 | // from sciter ... 49 | func snapCalled(vals ...*sciter.Value) *sciter.Value { 50 | 51 | // If inputs are not exactly 4 52 | // then something is wrong ... 53 | if len(vals) == 4 { 54 | x1 := vals[0].Int() 55 | y1 := vals[1].Int() 56 | x2 := vals[2].Int() 57 | y2 := vals[3].Int() 58 | // fmt.Println(x1, y2, x2, y2, " are the cordinates") 59 | takeASelfi(x1, y1, x2, y2) 60 | } 61 | 62 | return nil 63 | } 64 | 65 | // takeASefli takes two cordinates as input 66 | // creates a rectangle from those cordinates 67 | // and takes snaps of that rectanle and stores 68 | // it as a png image 69 | func takeASelfi(xi, yi, xe, ye int) { 70 | 71 | selfiRect := image.Rect(xi, yi, xe, ye) 72 | selfiData, err := screenshot.CaptureRect(selfiRect) 73 | if err != nil { 74 | fmt.Println("We failed to take a sefli. sorry ....", err.Error()) 75 | return 76 | } 77 | 78 | imageName, _ := uuid.NewV4() 79 | f, err := os.Create("./" + imageName.String() + ".png") 80 | if err != nil { 81 | panic(err) 82 | } 83 | err = png.Encode(f, selfiData) 84 | if err != nil { 85 | panic(err) 86 | } 87 | f.Close() 88 | 89 | } 90 | -------------------------------------------------------------------------------- /10 screen-selfi/packfolder.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/10 screen-selfi/packfolder.exe -------------------------------------------------------------------------------- /10 screen-selfi/res.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | var resources []byte = []byte { 4 | 0x53,0x41,0x72,0x00,0x2c,0x00,0x00,0x00,0x68,0x00,0xff,0xff,0x01,0x00,0x1b,0x00,0x74,0x00,0xff,0xff,0x02,0x00,0xff,0xff,0x64,0x00,0xff,0xff,0x03,0x00,0xff,0xff,0x6f,0x00,0xff,0xff,0x04,0x00,0xff,0xff,0x63, 5 | 0x00,0xff,0xff,0x05,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x06,0x00,0xff,0xff,0x2f,0x00,0xff,0xff,0x07,0x00,0xff,0xff,0x6d,0x00,0xff,0xff,0x08,0x00,0x10,0x00,0x61,0x00,0xff,0xff,0x09,0x00,0xff,0xff,0x69,0x00, 6 | 0xff,0xff,0x0a,0x00,0xff,0xff,0x6e,0x00,0xff,0xff,0x0b,0x00,0xff,0xff,0x2e,0x00,0xff,0xff,0x0c,0x00,0xff,0xff,0x68,0x00,0xff,0xff,0x0d,0x00,0xff,0xff,0x74,0x00,0xff,0xff,0x0e,0x00,0xff,0xff,0x6d,0x00,0xff, 7 | 0xff,0x0f,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x01,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x11,0x00,0xff,0xff,0x63,0x00,0xff,0xff,0x12,0x00,0xff,0xff,0x72,0x00,0xff,0xff,0x13,0x00,0xff,0xff,0x65,0x00,0xff,0xff, 8 | 0x14,0x00,0xff,0xff,0x65,0x00,0xff,0xff,0x15,0x00,0xff,0xff,0x6e,0x00,0xff,0xff,0x16,0x00,0xff,0xff,0x2e,0x00,0xff,0xff,0x17,0x00,0xff,0xff,0x68,0x00,0xff,0xff,0x18,0x00,0xff,0xff,0x74,0x00,0xff,0xff,0x19, 9 | 0x00,0xff,0xff,0x6d,0x00,0xff,0xff,0x1a,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x02,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x1c,0x00,0xff,0xff,0x74,0x00,0xff,0xff,0x1d,0x00,0xff,0xff,0x79,0x00,0xff,0xff,0x1e,0x00, 10 | 0xff,0xff,0x6c,0x00,0xff,0xff,0x1f,0x00,0xff,0xff,0x65,0x00,0xff,0xff,0x20,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x21,0x00,0xff,0xff,0x2f,0x00,0xff,0xff,0x22,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x23,0x00,0xff, 11 | 0xff,0x74,0x00,0xff,0xff,0x24,0x00,0xff,0xff,0x79,0x00,0xff,0xff,0x25,0x00,0xff,0xff,0x6c,0x00,0xff,0xff,0x26,0x00,0xff,0xff,0x65,0x00,0xff,0xff,0x27,0x00,0xff,0xff,0x2e,0x00,0xff,0xff,0x28,0x00,0xff,0xff, 12 | 0x63,0x00,0xff,0xff,0x29,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x2a,0x00,0xff,0xff,0x73,0x00,0xff,0xff,0x2b,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x03,0x00,0xff,0xff,0x03,0x00,0x00,0x00,0x90,0x01,0x00,0x00,0x30, 13 | 0x02,0x00,0x00,0x36,0x04,0x00,0x00,0xc0,0x03,0x00,0x00,0x39,0x03,0x00,0x00,0xb3,0x06,0x00,0x00,0xf9,0x06,0x00,0x00,0xeb,0x00,0x00,0x00,0x62,0x01,0x00,0x00,0x1f,0x3c,0x68,0x74,0x6d,0x6c,0x20,0x77,0x69,0x6e, 14 | 0x64,0x6f,0x77,0x2d,0x66,0x72,0x61,0x6d,0x65,0x3d,0x22,0x6e,0x6f,0x6e,0x65,0x22,0x3e,0x0d,0x0a,0x0d,0x0a,0x3c,0x68,0x02,0x65,0x61,0x64,0x20,0x09,0x00,0x20,0x20,0x00,0x05,0x3c,0x73,0x74,0x79,0x6c,0x65,0xa0, 15 | 0x0c,0x40,0x00,0x0e,0x40,0x69,0x6d,0x70,0x6f,0x72,0x74,0x20,0x75,0x72,0x6c,0x28,0x2e,0x2e,0x2f,0x60,0x1e,0x00,0x73,0x80,0x06,0x05,0x2e,0x63,0x73,0x73,0x29,0x3b,0xe0,0x01,0x2a,0x00,0x3c,0x80,0x16,0x20,0x3c, 16 | 0x01,0x3c,0x2f,0xa0,0x52,0x20,0x0a,0x03,0x62,0x6f,0x64,0x79,0x20,0x09,0x20,0x1f,0x16,0x20,0x3c,0x62,0x75,0x74,0x74,0x6f,0x6e,0x20,0x23,0x73,0x6e,0x61,0x70,0x3e,0x54,0x61,0x6b,0x65,0x20,0x41,0x20,0x53,0x20, 17 | 0x0b,0x01,0x3c,0x2f,0x80,0x19,0x20,0x27,0x20,0x0a,0x80,0x30,0x20,0x0a,0x09,0x73,0x63,0x72,0x69,0x70,0x74,0x20,0x74,0x79,0x70,0x20,0xaf,0x06,0x74,0x65,0x78,0x74,0x2f,0x74,0x69,0x80,0x13,0x80,0xb8,0x80,0x55, 18 | 0x0d,0x65,0x76,0x65,0x6e,0x74,0x20,0x63,0x6c,0x69,0x63,0x6b,0x20,0x24,0x28,0x60,0x5b,0x01,0x29,0x7b,0xc0,0x1c,0xe0,0x03,0x00,0x04,0x76,0x69,0x65,0x77,0x2e,0x81,0x04,0x00,0x28,0x20,0x20,0x20,0x11,0xe0,0x08, 19 | 0x00,0x20,0xe5,0x12,0x20,0x3a,0x22,0x74,0x68,0x69,0x73,0x3a,0x2f,0x2f,0x61,0x70,0x70,0x2f,0x68,0x74,0x64,0x6f,0x63,0x20,0xef,0x05,0x63,0x72,0x65,0x65,0x6e,0x2e,0x21,0x46,0x01,0x22,0x2c,0xe0,0x0d,0x39,0x07, 20 | 0x73,0x74,0x61,0x74,0x65,0x20,0x3a,0x56,0x40,0x63,0x11,0x57,0x49,0x4e,0x44,0x4f,0x57,0x5f,0x46,0x55,0x4c,0x4c,0x5f,0x53,0x43,0x52,0x45,0x45,0x4e,0xe0,0x0e,0x34,0x40,0xd9,0xa0,0x33,0x05,0x50,0x4f,0x50,0x55, 21 | 0x50,0x5f,0x80,0x39,0xe0,0x0e,0x2d,0x01,0x70,0x61,0x41,0xb9,0x08,0x74,0x65,0x72,0x73,0x20,0x3a,0x20,0x7b,0x20,0xe0,0x0d,0x24,0x40,0x00,0x03,0x6d,0x61,0x69,0x6e,0x40,0x54,0x00,0x3a,0x60,0xf2,0x00,0x2c,0x20, 22 | 0x11,0xe0,0x0a,0x00,0xe0,0x0d,0x3e,0x00,0x7d,0xe0,0x09,0x16,0x01,0x7d,0x29,0xe1,0x10,0x4c,0x80,0xf4,0x02,0x20,0x3d,0x20,0x40,0x6d,0xc0,0xf6,0x05,0x48,0x49,0x44,0x44,0x45,0x4e,0x20,0x22,0xe0,0x03,0x00,0xe0, 23 | 0x0b,0x42,0x0a,0x2f,0x2f,0x20,0x43,0x61,0x6c,0x6c,0x69,0x6e,0x67,0x20,0x41,0xb4,0x09,0x4e,0x6f,0x77,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x22,0x22,0x0f,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x69,0x6e,0x20,0x67, 24 | 0x6f,0x6c,0x61,0x6e,0x67,0xe0,0x0b,0x3d,0x80,0x82,0x80,0x39,0x00,0x28,0xe0,0x0b,0x20,0x20,0x04,0x12,0x20,0x74,0x6f,0x49,0x6e,0x74,0x65,0x67,0x65,0x72,0x28,0x73,0x65,0x6c,0x66,0x23,0x78,0x31,0x2e,0x42,0x48, 25 | 0x00,0x29,0xe1,0x0a,0x62,0x60,0x2f,0xe0,0x06,0x2e,0x00,0x79,0xc0,0x2e,0x20,0xc0,0x20,0x1d,0xe0,0x04,0x00,0x60,0x2f,0xe0,0x07,0x30,0x01,0x78,0x32,0xa0,0x30,0xe0,0x1e,0x2f,0x00,0x79,0xa0,0x2f,0xe0,0x0b,0x2e, 26 | 0x20,0x14,0xe0,0x0b,0x16,0x03,0x20,0x73,0x68,0x6f,0x22,0xc5,0x01,0x67,0x20,0x22,0x9f,0x22,0xf4,0x61,0x2e,0x20,0x0f,0x22,0xd5,0x05,0x20,0x61,0x67,0x69,0x61,0x6e,0xe0,0x09,0x33,0xe0,0x07,0x11,0x21,0xe4,0xe0, 27 | 0x01,0x12,0x80,0x09,0x23,0xbb,0x63,0x58,0x63,0x57,0x23,0xbe,0x03,0x74,0x6d,0x6c,0x3e,0x1f,0x3c,0x68,0x74,0x6d,0x6c,0x20,0x77,0x69,0x6e,0x64,0x6f,0x77,0x2d,0x66,0x72,0x61,0x6d,0x65,0x3d,0x22,0x74,0x72,0x61, 28 | 0x6e,0x73,0x70,0x61,0x72,0x65,0x6e,0x74,0x22,0x03,0x3e,0x0d,0x0a,0x20,0x20,0x00,0x04,0x3c,0x68,0x65,0x61,0x64,0xa0,0x0b,0x40,0x00,0x05,0x3c,0x73,0x74,0x79,0x6c,0x65,0xe0,0x02,0x10,0x40,0x00,0x0e,0x40,0x69, 29 | 0x6d,0x70,0x6f,0x72,0x74,0x20,0x75,0x72,0x6c,0x28,0x2e,0x2e,0x2f,0x60,0x22,0x00,0x73,0x80,0x06,0x05,0x2e,0x63,0x73,0x73,0x29,0x3b,0xe0,0x01,0x2e,0x00,0x3c,0x80,0x16,0xa0,0x40,0x01,0x3c,0x2f,0xe0,0x02,0x5e, 30 | 0x05,0x3c,0x62,0x6f,0x64,0x79,0x20,0x60,0x1e,0x15,0x3d,0x22,0x62,0x61,0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x3a,0x72,0x67,0x62,0x61,0x28,0x32,0x35,0x35,0x2c,0xc0,0x03,0x05,0x30,0x2e,0x36,0x29,0x22,0x3e, 31 | 0x20,0x31,0xe0,0x01,0x00,0x80,0x41,0x40,0x00,0x0d,0x3c,0x64,0x69,0x76,0x20,0x23,0x73,0x6e,0x61,0x70,0x5a,0x6f,0x6e,0x65,0xc0,0x4e,0x08,0x68,0x65,0x69,0x67,0x68,0x74,0x3a,0x2a,0x3b,0x20,0xf1,0x02,0x64,0x74, 32 | 0x68,0x40,0x08,0xc0,0xe1,0xc0,0x00,0xe0,0x01,0x38,0x08,0x41,0x72,0x65,0x61,0x3e,0x43,0x6f,0x6e,0x74,0x21,0x07,0x0f,0x20,0x73,0x68,0x6f,0x75,0x6c,0x64,0x20,0x67,0x6f,0x20,0x62,0x65,0x6c,0x6f,0x77,0x20,0xb1, 33 | 0x00,0x33,0xe0,0x01,0x7a,0xe0,0x01,0x41,0x01,0x3c,0x2f,0x20,0x3e,0xe0,0x02,0x51,0x40,0x4d,0xe0,0x03,0x0e,0x06,0x69,0x20,0x23,0x63,0x6c,0x6f,0x73,0xe0,0x00,0x90,0x0f,0x63,0x6f,0x6c,0x6f,0x72,0x3a,0x23,0x66, 34 | 0x66,0x66,0x22,0x3e,0x58,0x3c,0x2f,0x69,0xe0,0x03,0x2b,0x60,0x4a,0x20,0x08,0xe0,0x02,0x12,0x05,0x62,0x75,0x74,0x74,0x6f,0x6e,0x80,0x9e,0x03,0x49,0x74,0x3e,0x53,0x20,0x06,0x01,0x3c,0x2f,0x80,0x14,0xa0,0x39, 35 | 0x20,0x0e,0x21,0x3e,0x20,0x0c,0xa0,0x0e,0x09,0x73,0x63,0x72,0x69,0x70,0x74,0x20,0x74,0x79,0x70,0x20,0x6d,0x06,0x74,0x65,0x78,0x74,0x2f,0x74,0x69,0x80,0x13,0xe1,0x08,0x3a,0x80,0x31,0x40,0x00,0x0e,0x76,0x61, 36 | 0x72,0x20,0x78,0x31,0x2c,0x79,0x31,0x2c,0x78,0x32,0x2c,0x79,0x32,0xe1,0x02,0xb7,0x40,0x19,0x04,0x69,0x20,0x3d,0x20,0x30,0x20,0x13,0xe0,0x01,0x15,0x01,0x65,0x76,0x41,0x22,0x07,0x63,0x6c,0x69,0x63,0x6b,0x20, 37 | 0x24,0x28,0x60,0x9d,0x41,0x75,0x01,0x29,0x7b,0x20,0x1b,0xe0,0x0b,0x00,0xe0,0x01,0x39,0x40,0x00,0x0a,0x69,0x66,0x20,0x28,0x69,0x20,0x25,0x20,0x32,0x20,0x3d,0x20,0x58,0x01,0x29,0x7b,0xe0,0x05,0x1d,0x40,0x00, 38 | 0x00,0x28,0x60,0x8c,0x00,0x29,0x20,0x77,0x13,0x76,0x69,0x65,0x77,0x2e,0x63,0x75,0x72,0x73,0x6f,0x72,0x4c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0xe2,0x03,0x57,0xc0,0x00,0x60,0x27,0x12,0x6d,0x73,0x67,0x62, 39 | 0x6f,0x78,0x28,0x23,0x61,0x6c,0x65,0x72,0x74,0x2c,0x22,0x66,0x69,0x72,0x73,0x20,0xa5,0x0a,0x6f,0x72,0x64,0x20,0x6c,0x6f,0x61,0x64,0x65,0x64,0x22,0xe0,0x0b,0x39,0x02,0x69,0x2b,0x2b,0xe0,0x06,0x15,0x05,0x7d, 40 | 0x20,0x65,0x6c,0x73,0x65,0xe0,0x0c,0x96,0x41,0x1d,0xe0,0x37,0x96,0x05,0x73,0x65,0x63,0x6f,0x6e,0x64,0xe0,0x2b,0x97,0xe0,0x05,0x0e,0x41,0x46,0x03,0x78,0x31,0x20,0x21,0x21,0x43,0x05,0x20,0x26,0x26,0x20,0x78, 41 | 0x32,0x60,0x0a,0xe1,0x06,0x83,0xe0,0x05,0x32,0x40,0x00,0xa1,0xaf,0x42,0xec,0x0a,0x29,0x2e,0x24,0x72,0x65,0x70,0x6c,0x61,0x63,0x65,0x28,0x62,0xb8,0xc2,0xa4,0x03,0x70,0x6f,0x73,0x69,0x40,0xd2,0x19,0x3a,0x61, 42 | 0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x3b,0x74,0x6f,0x70,0x3a,0x7b,0x79,0x31,0x7d,0x3b,0x6c,0x65,0x66,0x74,0x3a,0x7b,0x78,0x20,0x09,0xa3,0x5a,0x0a,0x7b,0x79,0x32,0x2d,0x79,0x31,0x7d,0x64,0x69,0x70,0x3b,0x83, 43 | 0x62,0x03,0x7b,0x78,0x32,0x2d,0x20,0x1f,0x40,0x10,0xe3,0x15,0xcc,0x04,0x33,0x29,0x3b,0x22,0x3e,0x82,0xf4,0x00,0x29,0xe0,0x05,0xa6,0xe0,0x02,0xe8,0x20,0x0a,0xe0,0x01,0x0c,0x40,0x00,0xe2,0x06,0x7a,0x63,0x5c, 44 | 0xe0,0x06,0xf3,0xe0,0x0a,0xf4,0x61,0x87,0x24,0xe1,0x0c,0x61,0x6d,0x65,0x74,0x65,0x72,0x73,0x2e,0x6d,0x61,0x69,0x6e,0x56,0x40,0x13,0x04,0x73,0x74,0x61,0x74,0x65,0xc1,0xd0,0x0b,0x57,0x49,0x4e,0x44,0x4f,0x57, 45 | 0x5f,0x53,0x48,0x4f,0x57,0x4e,0x20,0x34,0xe0,0x06,0x00,0xe0,0x0e,0x55,0x60,0x81,0x01,0x28,0x29,0xe0,0x05,0x1d,0x20,0xb6,0x20,0x05,0xe0,0x00,0x00,0xe0,0x06,0xb4,0x41,0x7f,0x01,0x49,0x74,0xe2,0x0b,0xf8,0x60, 46 | 0x51,0x80,0x93,0x20,0x94,0x60,0xa1,0xa0,0x94,0x04,0x48,0x49,0x44,0x44,0x45,0x20,0x95,0xe0,0x0e,0x33,0xe0,0x0c,0xdb,0x20,0x66,0x02,0x4e,0x6f,0x77,0x22,0x24,0x23,0x4c,0x83,0xd9,0x00,0x29,0xe0,0x25,0x40,0x60, 47 | 0x88,0xe1,0x56,0x1c,0xe0,0x01,0x0c,0x80,0x09,0x26,0x29,0x64,0xae,0x24,0xd2,0x25,0x74,0x03,0x74,0x6d,0x6c,0x3e,0x07,0x68,0x74,0x6d,0x6c,0x20,0x0d,0x0a,0x7b,0x20,0x03,0x0d,0x20,0x20,0x66,0x6f,0x6e,0x74,0x3a, 48 | 0x73,0x79,0x73,0x74,0x65,0x6d,0x3b,0x40,0x0f,0x16,0x62,0x61,0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x3a,0x74,0x72,0x61,0x6e,0x73,0x70,0x61,0x72,0x65,0x6e,0x74,0x3b,0x60,0x2b,0x0f,0x6f,0x76,0x65,0x72,0x66, 49 | 0x6c,0x6f,0x77,0x3a,0x20,0x68,0x69,0x64,0x64,0x65,0x6e,0x20,0x30,0x09,0x7d,0x0d,0x0a,0x0d,0x0a,0x62,0x6f,0x64,0x79,0x7b,0x40,0x20,0xe0,0x04,0x3e,0x0a,0x20,0x72,0x67,0x62,0x61,0x28,0x32,0x30,0x30,0x2c,0x20, 50 | 0xe0,0x01,0x04,0x03,0x30,0x2e,0x35,0x29,0x20,0x36,0x20,0x29,0xe0,0x10,0x4d,0x20,0x1a,0x05,0x20,0x2e,0x6e,0x61,0x76,0x69,0xa0,0x52,0x40,0x00,0x0a,0x77,0x69,0x64,0x74,0x68,0x3a,0x20,0x31,0x30,0x30,0x25,0x20, 51 | 0x26,0x20,0x10,0x60,0x00,0xe0,0x03,0x6c,0x02,0x23,0x63,0x66,0x40,0x01,0xe0,0x02,0x1d,0x0c,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x3a,0x20,0x66,0x6c,0x65,0x78,0x80,0x16,0xe0,0x01,0x5f,0x02,0x62,0x74,0x6e,0xe0, 52 | 0x02,0x5e,0xe0,0x00,0x2a,0x0b,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x2d,0x62,0x6c,0x6f,0x63,0x6b,0xe0,0x02,0x4a,0x0c,0x70,0x61,0x64,0x64,0x69,0x6e,0x67,0x3a,0x20,0x33,0x30,0x70,0x78,0xe0,0x02,0x17,0xa0,0x96,0x01, 53 | 0x2a,0x3b,0x20,0x0b,0x60,0x00,0x60,0x1a,0x01,0x20,0x7d, 54 | } 55 | -------------------------------------------------------------------------------- /10 screen-selfi/res/htdocs/main.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 43 | 44 | -------------------------------------------------------------------------------- /10 screen-selfi/res/htdocs/screen.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 |
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 |
  1. Grab needed icon from one of normalized FontAwesome SVG files from here: https://github.com/encharm/Font-Awesome-SVG-PNG/tree/master/black/svg
  2. 19 |
  3. Copy content of <path d="..."> from the file.
  4. 20 |
  5. Add "path:" in front of it.
  6. 21 |
  7. And use it as a URL in <img src="..."> or back/foreground-image: url(...);
  8. 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 |
27 | 28 | 29 |
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 | 4 |
  • First
  • 5 |
  • Second
  • 6 | 7 |

    This is a homepage

    8 | 9 | -------------------------------------------------------------------------------- /16 Add Menu in menubar in MacOS /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | /** 4 | * every mac os x app is incomplete with-out its own unity bar menus 5 | * ..... 6 | * You can add it directly via sciter or golang itself. But ... 7 | * You can achive this via cgo [ And to be specific via Objective-c code] 8 | * How !. 9 | * 10 | * See this . 11 | */ 12 | 13 | /* 14 | #cgo CFLAGS: -x objective-c 15 | #cgo LDFLAGS: -framework Cocoa 16 | #import 17 | 18 | 19 | int LoadMenu(void) { 20 | [NSAutoreleasePool new]; 21 | [NSApplication sharedApplication]; 22 | [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; 23 | id menubar = [[NSMenu new] autorelease]; 24 | id appMenuItem = [[NSMenuItem new] autorelease]; 25 | [menubar addItem:appMenuItem]; 26 | [NSApp setMainMenu:menubar]; 27 | id appMenu = [[NSMenu new] autorelease]; 28 | id appName = [[NSProcessInfo processInfo] processName]; 29 | id quitTitle = [@"Quit " stringByAppendingString:appName]; 30 | id quitMenuItem = [[[NSMenuItem alloc] initWithTitle:quitTitle 31 | action:@selector(terminate:) keyEquivalent:@"q"] 32 | autorelease]; 33 | 34 | [appMenu addItem:[[[NSMenuItem alloc] initWithTitle:@"I am The menu" action:@selector(caller:) keyEquivalent:@""] autorelease] ]; 35 | [appMenu addItem:quitMenuItem]; 36 | 37 | [appMenuItem setSubmenu:appMenu]; 38 | 39 | return 0; 40 | } 41 | */ 42 | import "C" 43 | 44 | import ( 45 | "github.com/sciter-sdk/go-sciter" 46 | "github.com/sciter-sdk/go-sciter/window" 47 | ) 48 | 49 | func main() { 50 | 51 | // Call the cgo function that will bind menu to unitybar 52 | C.LoadMenu() 53 | 54 | // create rect for window 55 | rect := sciter.NewRect(200, 200, 800, 600) 56 | 57 | // create scister window object with rect 58 | win, _ := window.New(sciter.DefaultWindowCreateFlag, rect) 59 | 60 | // load index.html file in window 61 | win.LoadFile("./index.html") 62 | 63 | win.Show() 64 | 65 | win.Run() 66 | 67 | } 68 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /master/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/fatih/color" 7 | "github.com/sciter-sdk/go-sciter" 8 | "github.com/sciter-sdk/go-sciter/window" 9 | ) 10 | 11 | func main() { 12 | 13 | rect := sciter.NewRect(250, 200, 300, 300) 14 | window, windowsGenerateionError := window.New(sciter.SW_MAIN|sciter.SW_CONTROLS|sciter.SW_ENABLE_DEBUG, rect) 15 | 16 | if windowsGenerateionError != nil { 17 | color.RedString("Failed to generate sciter window ", windowsGenerateionError.Error()) 18 | } 19 | 20 | uiLoadingError := window.LoadFile("./main.html") 21 | if uiLoadingError != nil { 22 | color.RedString("Failed to load ui file ", uiLoadingError.Error()) 23 | } 24 | 25 | window.DefineFunction("Calc", Calc) 26 | 27 | // Setting up stage for Harmony 28 | window.SetTitle("Simple Input") 29 | window.Show() 30 | window.Run() 31 | 32 | } 33 | 34 | func Calc(vals ...*sciter.Value) *sciter.Value { 35 | ans := 0 36 | switch vals[2].String() { 37 | case "+": 38 | { 39 | ans = vals[1].Int() + vals[0].Int() 40 | } 41 | case "-": 42 | { 43 | ans = vals[1].Int() - vals[0].Int() 44 | } 45 | case "*": 46 | { 47 | ans = vals[1].Int() * vals[0].Int() 48 | } 49 | case "/": 50 | { 51 | ans = vals[1].Int() / vals[0].Int() 52 | } 53 | } 54 | fmt.Println("Ans is ", ans) 55 | return sciter.NewValue(ans) 56 | } 57 | -------------------------------------------------------------------------------- /master/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 |

    Simple Input

    8 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 22 | 25 | 28 | 29 | 30 | 33 | 36 | 39 | 42 | 43 | 44 | 47 | 50 | 53 | 56 | 57 | 58 | 59 | 62 | 65 | 66 | 67 |
    12 | 13 |
    17 | 18 | 20 | 21 | 23 | 24 | 26 | 27 |
    31 | 32 | 34 | 35 | 37 | 38 | 40 | 41 |
    45 | 46 | 48 | 49 | 51 | 52 | 54 | 55 |
    60 | 61 | 63 | 64 |
    68 | 110 | 111 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # About Repository 2 | 3 | Creating gui application with golang something nightmare before sometime[ until i found sciter sdk wrapper for Golang] for me. There is very less amount of resource available for go-sciter. So I am sharing this examples to give some contribution to create resource. 4 | 5 | ## About Programs 6 | 7 | No one is perfect in this world, so how one can create perfect things. Program written by me may be written in some another[ far better ] way. If you found something like that please make a pull request. I will be happy to review and merge it. 8 | I have explained almost all program listed below on my blog [ link to my blog ](https://www.mchampaneri.in) 9 | 10 | ## List of programs 11 | 12 | #### [01- HelloSciter](https://www.mchampaneri.in/2018/07/hello-sciter-program.html) 13 | Hello world equivilate program for sciter. Just to get you excited by showing window on screen. 14 | 15 | #### 02-HelloTIScript 16 | TIScript is extended version of JavaScript. This program contains small portion of TIScript to introduce TIScript. 17 | 18 | #### [03-TIScriptInput]((https://www.mchampaneri.in/2018/07/first-program-with-tiscript-and-sciter.html)) 19 | Moving one step forward in TIScript. This program shows how to access data from html inputs using TIScript. 20 | 21 | #### [04-CallGoFunctionFromTIscript](https://www.mchampaneri.in/2018/07/process-input-grabed-from-tiscript-in.html) 22 | Once you get input from HTML elements you may need to call a goLang function and process input. This program is simplest example of taking input from html via TIScript passing that data to goLang function and updating output on HTML element. 23 | 24 | #### [05-Calc[EndOfPart1]](https://www.mchampaneri.in/2018/07/simple-calc-using-golang-and-sciter-sdk.html) 25 | Summation of the journey until. It's a very simple calc which uses every thing we learn in earlier examples. 26 | 27 | #### [06-BuiltinHTML](https://www.mchampaneri.in/2018/07/embed-gui-inside-your-go-code.html) 28 | It's not good if you have to load external html file. As you have to care about location of html file. But instead what if html is inside your gocode? . It's cool right!. This is examples is about how to embedded html in your go code. 29 | 30 | #### [07-notepadScratch](https://www.mchampaneri.in/2018/07/simple-documnet-based-appliaction-with.html) 31 | Time to explore something new. This example contains code for extremely simple notepad. It just allows you to open file, write a new file , save it and exit the appliaction. But, Its a good example for those who want to make an application has to work with documents, right! of course. 32 | 33 | #### [08-packfolderIntro](https://www.mchampaneri.in/2018/08/use-packfolder-to-archive-your-resource.html) 34 | If you have gone through 06, it actully puts html/css code in go file. Which looks weird. Sciter-sdk comes with one utility called packfolder which can generate single archive for your resource folder in one of the supported output format. So, now there is no need to write your gui inside go code. You can use packfolder to use that code. 35 | 36 | If you are confused what i am talking about, please see the code, it might make you more clear. 37 | 38 | #### 09-image-viewer 39 | Image-viewer support png/jpg file to view. It autoloads every jpg/png file behind the scene and displays on screen existing in the same folder as executable.Its image loading logic is written in golang while front-end is sciter. UI may be create even better, but as this is just for example. 40 | ![Image of Image-Viewer](https://github.com/mchampaneri/go-sciter-example/blob/master/09%20image-viewer/image-viewer.png) 41 | 42 | 43 | #### 10-screen-sefli 44 | Screen-sefli takes snapshot of screen according to provided cordinates. 45 | ![Image of Screen-selfi](https://github.com/mchampaneri/go-sciter-example/blob/master/10%20screen-selfi/58c39b14-8eb5-457f-8bc5-504cb35bb3bb.png) 46 | 47 | #### 11-custome-layout 48 | 49 | #### 12-Sciter-glassy-background 50 | Sciter now supports glassy backgroun as well. You can give a modern glassy UI look to your appliaction. 51 | 52 | #### 13-Sciter-window-frame-extended 53 | You can customize titlebar. window-frame='exteded' removes title bar and puts windows controls in appliction body. 54 | ![Image](https://github.com/mchampaneri/go-sciter-example/blob/master/13%20sciter%20window-frame-extend/cover-Pic.png) 55 | 56 | #### 14-Add-button-with-onclick-event-binding-from-golang 57 | You can add any element with your desired attirubtes and event handing from golang side. How!, see this example. 58 | 59 | 60 | #### 15-Create-new-window-on-button-click 61 | It may happened that your application need multiple window to carry out certain task, for example to take profile pic you need a separate window with access to webcam that can take pic and the pass data to main window are application itself. 62 | Here is simple example of how you can create/open new window with button click 63 | 64 | #### 16-Add-menu-in-menubar-mac-os-x 65 | You can add menu in menubar of mac-os-x. Not using sciter or golang{direclty}. But Cgo comes at rescaue here. You can add menu using objective-c code using Cocoa framework at cgo. 66 | 67 | 68 | ----- 69 | 70 | 71 | ## Youtube playlists 72 | 73 | #### [Create GUI application in go using sciter-sdk](https://www.youtube.com/playlist?list=PLub5C2vM5SjKvkbFfposhyg1V2gpXnviM) 74 | Video tutorials on go-sciter for beginners -------------------------------------------------------------------------------- /xx-MultiPage/07-MultiPage.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/xx-MultiPage/07-MultiPage.exe -------------------------------------------------------------------------------- /xx-MultiPage/controller.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/sciter-sdk/go-sciter" 7 | ) 8 | 9 | func changepage(opt ...*sciter.Value) *sciter.Value { 10 | fmt.Println("yeah , we are on right path") 11 | appWindow.LoadHtml(screens(1), "/") 12 | return nil 13 | } 14 | -------------------------------------------------------------------------------- /xx-MultiPage/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 | var appWindow *window.Window 11 | var windowErr error 12 | 13 | func main() { 14 | 15 | // Creating A Reactangle of size we want 16 | rect := sciter.NewRect(200, 200, 400, 400) 17 | // Create Window Over The rect 18 | appWindow, windowErr = window.New(sciter.SW_MAIN|sciter.SW_CONTROLS| 19 | sciter.SW_ENABLE_DEBUG, rect) 20 | // If we cannot create window 21 | // Application execution has to be stopped 22 | // Because app has been failed in its first most stage 23 | if windowErr != nil { 24 | fmt.Errorf("Failed to create application window due to %s ", windowErr.Error()) 25 | return 26 | } 27 | uiLoadErr := appWindow.LoadHtml(screens(0), "/") 28 | if uiLoadErr != nil { 29 | fmt.Errorf("Failed to Load UI dur to %s ", uiLoadErr.Error()) 30 | return 31 | } 32 | 33 | appWindow.DefineFunction("changePage", changepage) 34 | appWindow.SetTitle("Score") 35 | appWindow.Show() 36 | appWindow.Run() 37 | 38 | } 39 | -------------------------------------------------------------------------------- /xx-MultiPage/pages.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func screens(i int) string { 4 | if i == 1 { 5 | return ` 6 | 7 | 8 | 9 | 10 |

    This is second page

    11 | 12 | 13 | ` 14 | } 15 | 16 | return ` 17 | 18 | 19 | 20 | 21 |

    No Html Files Need Any More

    22 | 23 | 24 | 30 | 31 | ` 32 | } 33 | -------------------------------------------------------------------------------- /xx-MultiPage/sciter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sciter-sdk/go-sciter-example/75c117c30ad587807c271356d8b15b219f990bbc/xx-MultiPage/sciter.png --------------------------------------------------------------------------------