TableContainer is now scrollable

This commit is contained in:
2023-04-03 23:09:02 -04:00
parent eca75c642b
commit 55c13ebf89
2 changed files with 119 additions and 7 deletions

View File

@@ -17,6 +17,7 @@ func run () {
container := containers.NewContainer(layouts.Vertical { true, true })
table := containers.NewTableContainer(7, 7, true, true)
scroller := containers.NewScrollContainer(true, true)
index := 0
for row := 0; row < 7; row ++ {
@@ -29,9 +30,10 @@ func run () {
}
index ++
}}
table.Set(2, 1, elements.NewButton("Look, I'm a button!"))
table.Set(2, 1, elements.NewButton("Oh hi mars!"))
statusLabel := elements.NewLabel("Selected: none", false)
table.Collapse(128, 128)
table.OnSelect (func () {
column, row := table.Selected()
statusLabel.SetText (
@@ -39,7 +41,8 @@ func run () {
column, row))
})
container.Adopt(table, true)
scroller.Adopt(table)
container.Adopt(scroller, true)
container.Adopt(statusLabel, false)
window.Adopt(container)