-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
51 lines (41 loc) · 922 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
// SPDX-FileCopyrightText: 2023 Weston Schmidt <[email protected]>
// SPDX-License-Identifier: Apache-2.0
package main
import (
"fmt"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"github.com/schmidtw/muggo/mug"
"github.com/schmidtw/muggo/mug/event"
)
func main() {
m, err := mug.New(
mug.WithChangeConnectionListener(
event.ConnectionChangeFunc(
func(evnt event.ConnectionChange) {
fmt.Printf("%s, Connected: %v\n", evnt.Address.String(), evnt.Connected)
},
)),
)
if err != nil {
panic(err)
}
m.Start()
a := app.New()
w := a.NewWindow("muggo")
battery := NewBattery(m)
battery.Start()
personalize := NewPersonalize(m, w)
personalize.Start()
state := NewState(m, w)
state.Start()
info := container.NewVBox(
state.Layout(),
container.NewGridWithColumns(2,
battery.Layout(),
personalize.Layout(),
),
)
w.SetContent(info)
w.ShowAndRun()
}