Browse Source

Remove wrapper methods

tablepad
Trevor Slocum 2 years ago
parent
commit
db81e43e00
  1. 6
      checkbox.go
  2. 5
      contextmenu.go
  3. 2
      demos/inputfield/autocompleteasync/main.go
  4. 6
      dropdown.go
  5. 6
      inputfield.go

6
checkbox.go

@ -145,12 +145,6 @@ func (c *CheckBox) SetLabelWidth(width int) *CheckBox {
return c
}
// SetBackgroundColor sets the background color.
func (c *CheckBox) SetBackgroundColor(color tcell.Color) *CheckBox {
c.Box.SetBackgroundColor(color)
return c
}
// SetLabelColor sets the color of the label.
func (c *CheckBox) SetLabelColor(color tcell.Color) *CheckBox {
c.Lock()

5
contextmenu.go

@ -13,7 +13,7 @@ type ContextMenu struct {
x, y int
selected func(int, string, rune)
l sync.Mutex
l sync.RWMutex
}
// NewContextMenu returns a new context menu.
@ -159,6 +159,9 @@ func (c *ContextMenu) show(item int, x int, y int, setFocus func(Primitive)) {
c.l.Unlock()
}
}).SetDoneFunc(func() {
c.l.Lock()
defer c.l.Unlock()
c.hide(setFocus)
})

2
demos/inputfield/autocompleteasync/main.go

@ -25,7 +25,7 @@ func main() {
})
// Set up autocomplete function.
var mutex sync.Mutex
var mutex sync.RWMutex
prefixMap := make(map[string][]*cview.ListItem)
inputField.SetAutocompleteFunc(func(currentText string) []*cview.ListItem {
// Ignore empty text.

6
dropdown.go

@ -273,12 +273,6 @@ func (d *DropDown) SetLabelWidth(width int) *DropDown {
return d
}
// SetBackgroundColor sets the background color.
func (d *DropDown) SetBackgroundColor(color tcell.Color) *DropDown {
d.Box.SetBackgroundColor(color)
return d
}
// SetLabelColor sets the color of the label.
func (d *DropDown) SetLabelColor(color tcell.Color) *DropDown {
d.Lock()

6
inputfield.go

@ -210,12 +210,6 @@ func (i *InputField) SetLabelWidth(width int) *InputField {
return i
}
// SetBackgroundColor sets the background color.
func (i *InputField) SetBackgroundColor(color tcell.Color) *InputField {
i.Box.SetBackgroundColor(color)
return i
}
// SetPlaceholder sets the text to be displayed when the input text is empty.
func (i *InputField) SetPlaceholder(text string) *InputField {
i.Lock()

Loading…
Cancel
Save