26 lines
521 B
Go
26 lines
521 B
Go
package main
|
|
|
|
import (
|
|
"image/color"
|
|
|
|
"fyne.io/fyne/v2"
|
|
"fyne.io/fyne/v2/app"
|
|
"fyne.io/fyne/v2/canvas"
|
|
"fyne.io/fyne/v2/container"
|
|
)
|
|
|
|
func main() {
|
|
application := app.New()
|
|
win := application.NewWindow("container")
|
|
win.SetMaster()
|
|
win.Resize(fyne.NewSize(300, 360))
|
|
|
|
green := color.NRGBA{0, 255, 0, 255}
|
|
txt1 := canvas.NewText("Hello", green)
|
|
txt2 := canvas.NewText("fyne", green)
|
|
txt2.Move(fyne.NewPos(20, 20))
|
|
content := container.NewWithoutLayout(txt1, txt2)
|
|
win.SetContent(content)
|
|
win.ShowAndRun()
|
|
}
|