summaryrefslogtreecommitdiff
path: root/listbox.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-07 19:28:25 -0500
committerPietro Gagliardi <[email protected]>2014-03-07 19:28:25 -0500
commit9dc6e6f7b39e9a3615ce21e2e03f82315038a470 (patch)
treed5d1a8e6ecb94aace8db132c8a9738907f01c06e /listbox.go
parent48fc6fbeabaa7242c8e69e7e6037faa296a6c44d (diff)
Pinned (or marked for later pinninig) behavior of various controls; also improved Space()'s documentation.
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()