29 lines
426 B
Go
29 lines
426 B
Go
|
package view
|
||
|
|
||
|
import (
|
||
|
"fyne.io/fyne/v2"
|
||
|
"fyne.io/fyne/v2/widget"
|
||
|
"gofin/audio"
|
||
|
)
|
||
|
import "fyne.io/fyne/v2/app"
|
||
|
|
||
|
var (
|
||
|
view View
|
||
|
)
|
||
|
|
||
|
type View struct {
|
||
|
app fyne.App
|
||
|
mainWindow fyne.Window
|
||
|
}
|
||
|
|
||
|
func CreateView() {
|
||
|
view.app = app.New()
|
||
|
view.mainWindow = view.app.NewWindow("Hello")
|
||
|
}
|
||
|
|
||
|
func PopulateView() {
|
||
|
btn := widget.NewButton("Play", audio.Play)
|
||
|
view.mainWindow.SetContent(btn)
|
||
|
view.mainWindow.ShowAndRun()
|
||
|
}
|