Vertical layout partially works

This commit is contained in:
2023-04-15 18:09:49 -04:00
parent 9e16f7b532
commit 986315d5db
8 changed files with 187 additions and 266 deletions

View File

@@ -1,9 +1,8 @@
package main
import "git.tebibyte.media/sashakoshka/tomo"
import "git.tebibyte.media/sashakoshka/tomo/layouts"
import "git.tebibyte.media/sashakoshka/tomo/elements"
import "git.tebibyte.media/sashakoshka/tomo/elements/testing"
// import "git.tebibyte.media/sashakoshka/tomo/elements/testing"
import "git.tebibyte.media/sashakoshka/tomo/elements/containers"
import _ "git.tebibyte.media/sashakoshka/tomo/backends/all"
@@ -15,8 +14,7 @@ func run () {
window, _ := tomo.NewWindow(tomo.Bounds(0, 0, 128, 128))
window.SetTitle("vertical stack")
container := containers.NewContainer(layouts.Vertical { true, true })
window.Adopt(container)
container := containers.NewVBox(true, true)
label := elements.NewLabel("it is a label hehe", true)
button := elements.NewButton("drawing pad")
@@ -24,7 +22,7 @@ func run () {
button.OnClick (func () {
container.DisownAll()
container.Adopt(elements.NewLabel("Draw here:", false), false)
container.Adopt(testing.NewMouse(), true)
// container.Adopt(testing.NewMouse(), true)
container.Adopt(okButton, false)
okButton.Focus()
})
@@ -35,6 +33,7 @@ func run () {
container.Adopt(okButton, false)
okButton.Focus()
window.Adopt(container)
window.OnClose(tomo.Stop)
window.Show()
}