mirror of https://github.com/rivo/tview.git
Added GetFormItemCount() to Form. Resolves #298
This commit is contained in:
parent
c1775d4e31
commit
9c225ecd57
12
form.go
12
form.go
|
@ -296,9 +296,15 @@ func (f *Form) AddFormItem(item FormItem) *Form {
|
||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFormItem returns the form element at the given position, starting with
|
// GetFormItemCount returns the number of items in the form (not including the
|
||||||
// index 0. Elements are referenced in the order they were added. Buttons are
|
// buttons).
|
||||||
// not included.
|
func (f *Form) GetFormItemCount() int {
|
||||||
|
return len(f.items)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetFormItem returns the form item at the given position, starting with index
|
||||||
|
// 0. Elements are referenced in the order they were added. Buttons are not
|
||||||
|
// included.
|
||||||
func (f *Form) GetFormItem(index int) FormItem {
|
func (f *Form) GetFormItem(index int) FormItem {
|
||||||
return f.items[index]
|
return f.items[index]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue