diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-11 20:44:04 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-11 20:44:04 -0400 |
| commit | 1e338afc4ae366c77da230699550a8be91074fcc (patch) | |
| tree | d50661f700e1232ad6d116a33df8406efa299d8c /listbox.go | |
| parent | a6188ec490f125b9eb6e6ac50637e898381c2522 (diff) | |
Split NewListbox() into NewListbox() (single-selection) and NewMultiSelListbox() (multiple selection); fixed the documentaiton for the Listbox constructor(s) to talk about Listbox and not Combobox, and added some TODOs.
Diffstat (limited to 'listbox.go')
| -rw-r--r-- | listbox.go | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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) { |
