-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.gui.go
86 lines (80 loc) · 1.88 KB
/
main.gui.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
// auto-generated
// Code generated by GUI builder.
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
)
type gui struct {
out *widget.Label
bc *widget.Button
bbo *widget.Button
bbc *widget.Button
bd *widget.Button
b7 *widget.Button
b8 *widget.Button
b9 *widget.Button
bm *widget.Button
b4 *widget.Button
b5 *widget.Button
b6 *widget.Button
bs *widget.Button
b1 *widget.Button
b2 *widget.Button
b3 *widget.Button
ba *widget.Button
b0 *widget.Button
bp *widget.Button
}
func newGUI() *gui {
return &gui{}
}
func (g *gui) makeUI() fyne.CanvasObject {
g.bbo = widget.NewButton("(", func() {})
g.b9 = widget.NewButton("9", func() {})
g.b1 = widget.NewButton("1", func() {})
g.ba = widget.NewButton("+", func() {})
g.bc = &widget.Button{Text: "C", Importance: 4, OnTapped: func() {}}
g.bbc = widget.NewButton(")", func() {})
g.b7 = widget.NewButton("7", func() {})
g.b6 = widget.NewButton("6", func() {})
g.bs = widget.NewButton("-", func() {})
g.bm = widget.NewButton("*", func() {})
g.b3 = widget.NewButton("3", func() {})
g.bp = widget.NewButton(".", func() {})
g.out = widget.NewLabel("0")
g.bd = widget.NewButton("/", func() {})
g.b8 = widget.NewButton("8", func() {})
g.b4 = widget.NewButton("4", func() {})
g.b5 = widget.NewButton("5", func() {})
g.b2 = widget.NewButton("2", func() {})
g.b0 = widget.NewButton("0", func() {})
return container.NewGridWithColumns(1,
g.out,
container.NewGridWithColumns(4,
g.bc,
g.bbo,
g.bbc,
g.bd),
container.NewGridWithColumns(4,
g.b7,
g.b8,
g.b9,
g.bm),
container.NewGridWithColumns(4,
g.b4,
g.b5,
g.b6,
g.bs),
container.NewGridWithColumns(4,
g.b1,
g.b2,
g.b3,
g.ba),
container.NewGridWithColumns(2,
container.NewGridWithColumns(2,
g.b0,
g.bp),
&widget.Button{Text: "=", Importance: 1, OnTapped: g.evaluate}))
}