Updated the examples

This commit is contained in:
Sasha Koshka
2023-04-18 16:18:30 -04:00
parent 14080b1f88
commit 7cdc5868e5
20 changed files with 271 additions and 169 deletions

View File

@@ -9,7 +9,6 @@ import "git.tebibyte.media/sashakoshka/tomo"
import "git.tebibyte.media/sashakoshka/tomo/popups"
import "git.tebibyte.media/sashakoshka/tomo/elements"
import _ "git.tebibyte.media/sashakoshka/tomo/backends/all"
import "git.tebibyte.media/sashakoshka/tomo/elements/containers"
func main () {
tomo.Run(run)
@@ -25,7 +24,7 @@ func run () {
file.Close()
if err != nil { fatalError(window, err); return }
container := containers.NewVBox(true, true)
container := elements.NewVBox(elements.SpaceBoth)
logoImage := elements.NewImage(logo)
button := elements.NewButton("Show me a gopher instead")
button.OnClick (func () {
@@ -34,11 +33,11 @@ func run () {
gopher, _, err :=
image.Decode(bytes.NewReader(gopher.GopherPng()))
if err != nil { fatalError(window, err); return }
container.Adopt(elements.NewImage(gopher),true)
container.AdoptExpand(elements.NewImage(gopher))
})
container.Adopt(logoImage, true)
container.Adopt(button, false)
container.AdoptExpand(logoImage)
container.Adopt(button)
window.Adopt(container)
button.Focus()