-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
70 lines (57 loc) · 1.38 KB
/
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
62
63
64
65
66
67
68
69
70
package main
import (
"elasapp/officer"
"elasapp/search"
"elasapp/violation"
"strings"
"github.com/lxn/walk"
dec "github.com/lxn/walk/declarative"
)
func mainMenu(buttonNames []string, fNames []func()) dec.VSplitter {
vSplitter := dec.VSplitter{}
vSplitter.Children = []dec.Widget{}
for i := range buttonNames {
widGet := dec.PushButton{
Text: buttonNames[i],
OnClicked: fNames[i],
Font: dec.Font{PointSize: 12},
}
vSplitter.Children = append(vSplitter.Children, widGet)
}
return vSplitter
}
func main() {
var inTE, outTE *walk.TextEdit
buttonNames := []string{"Διοικητής", "Αρμόδιος", "Παράβαση", "Αναζήτηση"}
fNames := []func(){
func() {
officer.Init(GetDB(), 1)
}, func() {
officer.Init(GetDB(), 0)
}, func() {
violation.Init(GetDB(), "")
}, func() {
search.Init(GetDB())
}, func() {
outTE.SetText(strings.ToUpper(inTE.Text()))
},
}
dec.MainWindow{
Title: "Εφαρμογή ΕΛΑΣ",
Bounds: dec.Rectangle{Width: 800, Height: 600},
Layout: dec.VBox{},
Children: []dec.Widget{
dec.HSplitter{
Children: []dec.Widget{
mainMenu(buttonNames, fNames),
dec.TextEdit{AssignTo: &inTE},
},
},
},
}.Run()
// Or read from memory
// r, err := docx.ReadDocxFromMemory(data io.ReaderAt, size int64)
db.Close()
// Or write to ioWriter
// docx2.Write(ioWriter io.Writer)
}