47 lines
633 B
Go
47 lines
633 B
Go
package main
|
|
|
|
/*
|
|
test fyne code
|
|
*/
|
|
|
|
import (
|
|
fyne "fyne.io/fyne/v2"
|
|
"fyne.io/fyne/v2/app"
|
|
"fyne.io/fyne/v2/container"
|
|
"fyne.io/fyne/v2/widget"
|
|
)
|
|
|
|
var a fyne.App
|
|
var w fyne.Window
|
|
var w2 fyne.Window
|
|
|
|
func fynetest() {
|
|
a = app.New()
|
|
w = a.NewWindow("Hello")
|
|
|
|
hello := widget.NewLabel("Hello Fyne!")
|
|
w.SetContent(container.NewVBox(
|
|
hello,
|
|
widget.NewButton("Hi!", func() {
|
|
hello.SetText("Welcome :)")
|
|
bobWindow()
|
|
}),
|
|
))
|
|
|
|
w.Show()
|
|
|
|
// bobWindow()
|
|
// go w.ShowAndRun()
|
|
}
|
|
|
|
func bobWindow() {
|
|
bw := a.NewWindow("Hello bob")
|
|
bob := widget.NewLabel("bob")
|
|
|
|
bw.SetContent(container.NewVBox(
|
|
bob,
|
|
))
|
|
|
|
bw.Show()
|
|
}
|