diff options
| author | Pietro Gagliardi <[email protected]> | 2014-02-15 18:14:43 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-02-15 18:14:43 -0500 |
| commit | 14aaad6be38d6ec23ac6b14d76496f8a38676597 (patch) | |
| tree | acc77ceb440d49ffd23231046558031124f084ad /listbox.go | |
| parent | 3c25b58652b55ee27a8c3c1f09e88a1eb593ca39 (diff) | |
Added Combobox.Delete() and Listbox.Delete() and added some TODOs.
Diffstat (limited to 'listbox.go')
| -rw-r--r-- | listbox.go | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -53,6 +53,18 @@ func (l *Listbox) InsertBefore(what string, before int) (err error) { return nil } +// Delete removes the given item from the Listbox. +func (l *Listbox) Delete(index int) error { + l.lock.Lock() + defer l.lock.Unlock() + + if l.created { + return l.sysData.delete(index) + } + l.initItems = append(l.initItems[:index], l.initItems[index + 1:]...) + return nil +} + // TODO Selection // TODO SelectedIndices |
