List element's events make more sense

Removed redundant selected entry change event, and added an event
that fires when the user deselects the current element.
This commit is contained in:
2023-01-26 12:05:28 -05:00
parent 48679c8ad2
commit 9aea6d8c0f
2 changed files with 36 additions and 23 deletions

View File

@@ -29,6 +29,9 @@ func run () {
})
}
intro := basic.NewLabel (
"The List element can be easily used as a sidebar. " +
"Click on entries to flip pages!", true)
button := basic.NewButton("I do nothing!")
button.OnClick (func () {
popups.NewDialog(popups.DialogKindInfo, "", "Sike!")
@@ -47,12 +50,11 @@ func run () {
basic.NewListEntry("mouse", func () { turnPage(mouse) }),
basic.NewListEntry("input", func () { turnPage(input) }),
basic.NewListEntry("form", func () { turnPage(form) }))
list.OnNoEntrySelected(func () { turnPage (intro) })
list.Collapse(96, 0)
container.Adopt(list, false)
turnPage (basic.NewLabel (
"The List element can be easily used as a sidebar. " +
"Click on entries to flip pages!", true))
turnPage(intro)
window.OnClose(tomo.Stop)
window.Show()