Scroll now has a constructor similar to Cell

This commit is contained in:
2023-04-17 02:13:21 -04:00
parent 5ca3b80e8e
commit 427b5e025d
5 changed files with 8 additions and 12 deletions

View File

@@ -13,10 +13,7 @@ func run () {
window, _ := tomo.NewWindow(tomo.Bounds(0, 0, 256, 256))
window.SetTitle("Text alignment")
container := containers.NewDocument()
scrollContainer := elements.NewScroll(false, true)
scrollContainer.Adopt(container)
window.Adopt(scrollContainer)
container := elements.NewDocument()
left := elements.NewLabel(text, true)
center := elements.NewLabel(text, true)
@@ -32,6 +29,7 @@ func run () {
container.Adopt(center, true)
container.Adopt(right, true)
container.Adopt(justify, true)
window.Adopt(elements.NewScroll(container, false, true))
window.OnClose(tomo.Stop)
window.Show()