summaryrefslogtreecommitdiff
path: root/listbox.go
diff options
context:
space:
mode:
Diffstat (limited to 'listbox.go')
-rw-r--r--listbox.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/listbox.go b/listbox.go
index fa925d0..e95b5cf 100644
--- a/listbox.go
+++ b/listbox.go
@@ -6,7 +6,8 @@ import (
"sync"
)
-// A Listbox is a vertical list of items, of which one or (optionally) more items can be selected at any given time.
+// A Listbox is a vertical list of items, of which either at most one or any number of items can be selected at any given time.
+// On creation, no item is selected.
type Listbox struct {
// TODO Select event
@@ -45,6 +46,7 @@ func (l *Listbox) Append(what ...string) (err error) {
}
// InsertBefore inserts a new item in the Listbox before the item at the given position.
+// (TODO action on invalid index)
func (l *Listbox) InsertBefore(what string, before int) (err error) {
l.lock.Lock()
defer l.lock.Unlock()
@@ -60,6 +62,7 @@ func (l *Listbox) InsertBefore(what string, before int) (err error) {
}
// Delete removes the given item from the Listbox.
+// (TODO action on invalid index)
func (l *Listbox) Delete(index int) error {
l.lock.Lock()
defer l.lock.Unlock()