@ -9,6 +9,7 @@ v1.5.0 (WIP)
- Revamp FormItem styling as FormItem.SetAttributes
- Provide DropDownOption in DropDown handlers
- Provide ListItem in List handlers
- Panic when attempting to add an invalid FormItem
v1.4.9 (2020-09-08)
- Add InputField.GetCursorPosition and InputField.SetCursorPosition
@ -1,6 +1,7 @@
package cview
import (
"reflect"
"sync"
"github.com/gdamore/tcell/v2"
@ -454,6 +455,10 @@ func (f *Form) AddFormItem(item FormItem) *Form {
f.Lock()
defer f.Unlock()
if reflect.ValueOf(item).IsNil() {
panic("Invalid FormItem")
}
f.items = append(f.items, item)
return f