-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
61 lines (54 loc) · 1013 Bytes
/
main.go
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
package main
import (
"flag"
"fmt"
"os"
"github.com/gotk3/gotk3/gtk"
)
const (
version = "2.2.0.0"
)
var (
master map[string][]app
linmaster map[string][]app
cats []string
lin []string
comEnbld bool
populated bool
)
func main() {
forced := flag.Bool("force-update", false, "Force the update dialog to be shown")
flag.Parse()
os.MkdirAll("PortableApps/LinuxPACom", 0777)
master = make(map[string][]app)
linmaster = make(map[string][]app)
uiStart(*forced)
}
func uiStart(forced bool) {
gtk.Init(nil)
setup()
win, err := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
if err != nil {
fmt.Println("Window not created", err)
}
win.SetTitle("LinuxPA")
win.Connect("destroy", func() {
savePrefs()
gtk.MainQuit()
})
win.SetDefaultSize(500, 500)
win.SetPosition(gtk.WIN_POS_CENTER)
ui(win)
win.ShowAll()
win.Show()
update(win, forced)
gtk.Main()
}
func contains(arr []string, str string) bool {
for _, v := range arr {
if v == str {
return true
}
}
return false
}