-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
94 lines (86 loc) · 1.88 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package main
import (
"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/theme"
"fyne.io/fyne/widget"
"log"
)
type (
application struct {
fyne.App
}
)
func main() {
if err := run(); err != nil {
log.Fatalln(err)
}
}
func run() error {
a := &application{App: app.New()}
a.Settings().SetTheme(theme.LightTheme())
win := a.NewWindow("Timers")
hour := NewNumericFieldRange(0, 999)
min := NewNumericFieldRange(0, 60)
min.Text = "10"
sec := NewNumericFieldRange(0, 60)
button1 := widget.NewButton("GO", nil)
win.SetContent(
widget.NewVBox(
widget.NewHBox(
hour, min, sec,
button1,
),
widget.NewHBox(
widget.NewButton("+", func() {}),
widget.NewButton("Quit", func() { a.Quit() }),
),
),
)
win.ShowAndRun()
return nil
}
//func main() {
// a := app.New()
// win := a.NewWindow("Window Test")
// hour := widget.NewEntry()
// hour.Text = "00"
// hour.OnChanged = hourChanged
// min := widget.NewEntry()
// min.Text = "14"
// sec := widget.NewEntry()
// sec.Text = "59"
// win.SetContent(
// widget.NewVBox(
// widget.NewHBox(
// hour, min, sec,
// widget.NewButton("GO", func() { showTime(hour.Text, min.Text, sec.Text) }),
// ),
// widget.NewHBox(
// widget.NewButton("+", func() {}),
// widget.NewButton("Quit", func() { a.Quit() }),
// ),
// ),
// )
// win.ShowAndRun()
//}
//func main() {
// a := &application{App: app.New()}
// win := a.NewWindow("Timer")
// win.SetContent(
// widget.NewVBox(
// widget.NewLabel("Click a button below to run a test"),
// widget.NewButton("Progress Bar", a.testProgressBar),
// widget.NewButton("Email", a.testEmail),
// widget.NewButton("Timer", a.testTimer),
// widget.NewCheck("check", func(b bool){
// print(b)
// }),
// widget.NewEntry(),
// widget.NewMultiLineEntry(),
// widget.NewProgressBar(),
// widget.NewButton("Quit", func() { a.Quit() }),
// ),
// )
// win.ShowAndRun()
//}