diff options
| author | Pietro Gagliardi <[email protected]> | 2014-02-25 15:13:37 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-02-25 15:13:37 -0500 |
| commit | 7aa84e26f0405b12ab9bbeb6001ec1af64e7a006 (patch) | |
| tree | 01791424264db6750a52c7d8b2fda480ed9f883e /combobox.go | |
| parent | 06fa3a5174e02ebf1061e67e60530c6d519eb9c1 (diff) | |
Split NewCombobox() into separate functions NewCombobox() and NewEditableCombobox().
Diffstat (limited to 'combobox.go')
| -rw-r--r-- | combobox.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/combobox.go b/combobox.go index 255bcf0..d01badd 100644 --- a/combobox.go +++ b/combobox.go @@ -15,8 +15,7 @@ type Combobox struct { initItems []string } -// NewCombobox makes a new combobox with the given items. If editable is true, the combobox is editable. -func NewCombobox(editable bool, items ...string) (c *Combobox) { +func newCombobox(editable bool, items ...string) (c *Combobox) { c = &Combobox{ sysData: mksysdata(c_combobox), initItems: items, @@ -25,6 +24,16 @@ func NewCombobox(editable bool, items ...string) (c *Combobox) { return c } +// NewCombobox makes a new Combobox with the given items. +func NewCombobox(items ...string) *Combobox { + return newCombobox(false, items...) +} + +// NewEditableCombobox makes a new editable Combobox with the given items. +func NewEditableCombobox(items ...string) *Combobox { + return newCombobox(true, items...) +} + // Append adds an item to the end of the Combobox's list. func (c *Combobox) Append(what string) (err error) { c.lock.Lock() |
