-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
73 lines (68 loc) · 1.41 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
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/widget"
)
//github.com/fyne-io/examples/blob/53445faa6dcc/clock/clock.go
var myapp fyne.App = app.New()
var myWindow fyne.Window = myapp.NewWindow("Virtual OS")
var btn1 fyne.Widget
var btn2 fyne.Widget
var btn3 fyne.Widget
var btn4 fyne.Widget
var btn5 fyne.Widget
var panelContent *fyne.Container
func main() {
clockOn := false
img := canvas.NewImageFromFile("wallpaper.png")
img.Resize(fyne.NewSize(1260, 980))
myWindow.Resize(fyne.NewSize(1440, 1080))
btn1 = widget.NewButton("Calculator", func() {
showCalc()
})
btn2 = widget.NewButton("Weather", func() {
showWeatherApp()
})
btn3 = widget.NewButton("Gallery", func() {
showGalleryApp()
})
btn4 = widget.NewButton("Text Editor", func() {
showTextEditor()
})
btn5 = widget.NewButton("Clock", func() {
if clockOn == false {
Show()
clockOn = true
} else {
clockClose()
clockOn = false
}
})
top := widget.NewLabelWithStyle(" ", fyne.TextAlignCenter, fyne.TextStyle{
Bold: true,
Monospace: true,
})
bottom := container.NewGridWithColumns(
5,
btn1,
btn2,
btn3,
btn4,
btn5,
)
side2 := widget.NewLabel(" ")
myWindow.SetContent(container.New(layout.NewMaxLayout(),
img,
container.NewBorder(
top,
bottom,
side2,
nil,
),
))
myWindow.ShowAndRun()
}