User can now select table cells

This commit is contained in:
2023-04-03 22:22:29 -04:00
parent ebefcb03b3
commit b357768c36
2 changed files with 98 additions and 26 deletions

View File

@@ -29,10 +29,18 @@ func run () {
}
index ++
}}
table.Set(2, 1, elements.NewButton("Look, I'm a button!"))
statusLabel := elements.NewLabel("Selected: none", false)
table.OnSelect (func () {
column, row := table.Selected()
statusLabel.SetText (
fmt.Sprintf("Selected: %d, %d",
column, row))
})
container.Adopt(table, true)
container.Adopt(statusLabel, false)
window.Adopt(container)
window.OnClose(tomo.Stop)