Add Flex.Clear() method to remove all items

This commit is contained in:
Ben LeFevre 2020-01-21 13:13:47 -05:00
parent 1316ea7a4b
commit 37b143d5fa
1 changed files with 6 additions and 0 deletions

View File

@ -101,6 +101,12 @@ func (f *Flex) RemoveItem(p Primitive) *Flex {
return f return f
} }
// Clear removes all items from the flexbox
func (f *Flex) Clear() *Flex {
f.items = nil
return f
}
// ResizeItem sets a new size for the item(s) with the given primitive. If there // ResizeItem sets a new size for the item(s) with the given primitive. If there
// are multiple Flex items with the same primitive, they will all receive the // are multiple Flex items with the same primitive, they will all receive the
// same size. For details regarding the size parameters, see AddItem(). // same size. For details regarding the size parameters, see AddItem().