summaryrefslogtreecommitdiff
path: root/listbox.go
diff options
context:
space:
mode:
Diffstat (limited to 'listbox.go')
-rw-r--r--listbox.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/listbox.go b/listbox.go
index 7e05287..cdb6c2d 100644
--- a/listbox.go
+++ b/listbox.go
@@ -17,8 +17,7 @@ type Listbox struct {
initItems []string
}
-// NewCombobox makes a new combobox with the given items. If multiple is true, the listbox allows multiple selection.
-func NewListbox(multiple bool, items ...string) (l *Listbox) {
+func newListbox(multiple bool, items ...string) (l *Listbox) {
l = &Listbox{
sysData: mksysdata(c_listbox),
initItems: items,
@@ -27,6 +26,16 @@ func NewListbox(multiple bool, items ...string) (l *Listbox) {
return l
}
+// NewListbox creates a new single-selection Listbox with the given items loaded initially.
+func NewListbox(items ...string) *Listbox {
+ return newListbox(false, items...)
+}
+
+// NewMultiSelListbox creates a new multiple-selection Listbox with the given items loaded initially.
+func NewMultiSelListbox(items ...string) *Listbox {
+ return newListbox(true, items...)
+}
+
// Append adds items to the end of the Listbox's list.
// Append will panic if something goes wrong on platforms that do not abort themselves.
func (l *Listbox) Append(what ...string) {