opens multiple windows in demo mode
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
5cc617335d
commit
3539402c37
4
Makefile
4
Makefile
|
@ -4,6 +4,10 @@ all: plugin
|
|||
plugin:
|
||||
go build -v -x -buildmode=plugin -o ../fyne.so
|
||||
|
||||
non-plugin:
|
||||
go build -v -x
|
||||
./fyne
|
||||
|
||||
check-git-clean:
|
||||
@git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1)
|
||||
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
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()
|
||||
}
|
21
main.go
21
main.go
|
@ -10,9 +10,6 @@ package main
|
|||
import (
|
||||
"go.wit.com/log"
|
||||
"go.wit.com/toolkits/tree"
|
||||
"fyne.io/fyne/v2/app"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -36,27 +33,11 @@ func init() {
|
|||
showOptions()
|
||||
|
||||
go simpleStdin()
|
||||
fynetest()
|
||||
}
|
||||
|
||||
// this must be defined for plugin's, but is never run
|
||||
// if you build this as a non-plugin, this will run
|
||||
func main() {
|
||||
fynetest()
|
||||
}
|
||||
|
||||
|
||||
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 :)")
|
||||
}),
|
||||
))
|
||||
|
||||
w.ShowAndRun()
|
||||
a.Run()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue