summaryrefslogtreecommitdiff
path: root/splash.go
blob: 6304864b2c91640337c1561e0c825aa094832884 (plain)
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
package gui

// import "github.com/davecgh/go-spew/spew"
// import "time"
// import "fmt"

// import "log"
import "runtime"

import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest"

func ShowSplashBox(vbox *ui.Box, atest chan int, custom func(int, string)) *ui.Box {
	newbox := ui.NewVerticalBox()
	newbox.SetPadded(true)

	makeAttributedString()
	Data.MyArea = makeSplashArea(custom)

	newbox.Append(Data.MyArea, true)

	if runtime.GOOS == "linux" {
		newbox.Append(ui.NewLabel("OS: Linux"), false)
	} else if runtime.GOOS == "windows" {
		newbox.Append(ui.NewLabel("OS: Windows"), false)
	} else {
		newbox.Append(ui.NewLabel("OS: " + runtime.GOOS), false)
	}

	version := "Version: " + Data.Version
	newbox.Append(ui.NewLabel(version), false)
	okButton := CreateButton("OK", "CLOSE", custom)
	newbox.Append(okButton, false)

	if (vbox != nil) {
		vbox.Append(newbox, true)
	}

	return newbox
}