Updated the examples
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user