-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
52 lines (38 loc) · 786 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
package main
import (
"log"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
"go.etcd.io/bbolt"
)
type item struct {
What string
Checked bool
}
type shoppingList struct {
Name string
Items []item
key uint64
list *widget.List
filterEntry *widget.Entry
}
type appData struct {
shoppingLists []*shoppingList
db *bbolt.DB
app fyne.App
win fyne.Window
tabs *container.DocTabs
}
func main() {
a := app.NewWithID("github.com.bluebugs.shopping")
myApp := &appData{shoppingLists: []*shoppingList{}, app: a, win: a.NewWindow("Shopping List")}
if err := myApp.loadShoppingLists(); err != nil {
log.Panic(err)
}
defer myApp.Close()
selfManage(a, myApp.win)
myApp.createUI()
myApp.win.ShowAndRun()
}