diff --git a/box.go b/box.go index ca5df43..fa77496 100644 --- a/box.go +++ b/box.go @@ -94,7 +94,7 @@ func (b *Box) GetInnerRect() (int, int, int, int) { height - b.paddingTop - b.paddingBottom } -// SetRect sets a new position of the rectangle. +// SetRect sets a new position of the primitive. func (b *Box) SetRect(x, y, width, height int) { b.x = x b.y = y diff --git a/form.go b/form.go index ca86eca..2b88fe3 100644 --- a/form.go +++ b/form.go @@ -191,6 +191,16 @@ func (f *Form) AddButton(label string, selected func()) *Form { return f } +// Clear removes all input elements from the form, including the buttons if +// specified. +func (f *Form) Clear(includeButtons bool) *Form { + f.items = nil + if includeButtons { + f.buttons = nil + } + return f +} + // GetFormItem returns the form element at the given position, starting with // index 0. Elements are referenced in the order they were added. Buttons are // not included.