WidgetGroup
WidgetGroup is a container which can add child widgets. Widget inherints from WidgetGroup can add child widgets as well.
Note
We will add a WidgetGroup for all widget inherints from it.
Basic properties
All properties can be accessed via Java / KubeJS.
| Field | Description |
|---|---|
widgets |
all child widgets |
layout |
layout of child widgets |
layoutPadding |
padding offset |
Warning
DO NOT add widget to the group.widgets directly!! please check below methods.
APIs
addWidgets()
Add child widgets to it in order.
removeWidget() / clearAllWidgets()
Remove child widget from it.
waitToAdded() / waitToRemoved()
Basically equals to the addWidgets() and removeWidget(). However, these two methods is useful for iteration and multi-thread. It handles widget in the next tick (in main thread).