summaryrefslogtreecommitdiff
path: root/listbox.go
diff options
context:
space:
mode:
Diffstat (limited to 'listbox.go')
-rw-r--r--listbox.go23
1 files changed, 0 insertions, 23 deletions
diff --git a/listbox.go b/listbox.go
index fc57142..774f553 100644
--- a/listbox.go
+++ b/listbox.go
@@ -4,7 +4,6 @@ package ui
import (
"fmt"
- "sync"
)
// 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.
@@ -12,7 +11,6 @@ import (
// For information on scrollbars, see "Scrollbars" in the Overview.
// Due to implementation issues, the presence of horizontal scrollbars is currently implementation-defined.
type Listbox struct {
- lock sync.Mutex
created bool
sysData *sysData
initItems []string
@@ -40,9 +38,6 @@ func NewMultiSelListbox(items ...string) *Listbox {
// 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) {
- l.lock.Lock()
- defer l.lock.Unlock()
-
if l.created {
for _, s := range what {
l.sysData.append(s)
@@ -55,9 +50,6 @@ func (l *Listbox) Append(what ...string) {
// InsertBefore inserts a new item in the Listbox before the item at the given position. It panics if the given index is out of bounds.
// InsertBefore will also panic if something goes wrong on platforms that do not abort themselves.
func (l *Listbox) InsertBefore(what string, before int) {
- l.lock.Lock()
- defer l.lock.Unlock()
-
var m []string
if l.created {
@@ -81,9 +73,6 @@ badrange:
// Delete removes the given item from the Listbox. It panics if the given index is out of bounds.
func (l *Listbox) Delete(index int) {
- l.lock.Lock()
- defer l.lock.Unlock()
-
if l.created {
if index < 0 || index >= l.sysData.len() {
goto badrange
@@ -102,9 +91,6 @@ badrange:
// Selection returns a list of strings currently selected in the Listbox, or an empty list if none have been selected. This list will have at most one item on a single-selection Listbox.
func (l *Listbox) Selection() []string {
- l.lock.Lock()
- defer l.lock.Unlock()
-
if l.created {
return l.sysData.selectedTexts()
}
@@ -113,9 +99,6 @@ func (l *Listbox) Selection() []string {
// SelectedIndices returns a list of the currently selected indexes in the Listbox, or an empty list if none have been selected. This list will have at most one item on a single-selection Listbox.
func (l *Listbox) SelectedIndices() []int {
- l.lock.Lock()
- defer l.lock.Unlock()
-
if l.created {
return l.sysData.selectedIndices()
}
@@ -126,9 +109,6 @@ func (l *Listbox) SelectedIndices() []int {
//
// On platforms for which this function may return an error, it panics if one is returned.
func (l *Listbox) Len() int {
- l.lock.Lock()
- defer l.lock.Unlock()
-
if l.created {
return l.sysData.len()
}
@@ -136,9 +116,6 @@ func (l *Listbox) Len() int {
}
func (l *Listbox) make(window *sysData) (err error) {
- l.lock.Lock()
- defer l.lock.Unlock()
-
err = l.sysData.make(window)
if err != nil {
return err