| add(w:abguibase.Widget, hweight=1, vweight=1) | Add a child widget to this box. |
| addHFiller(hweight=...) | Add a horizontal filler widget to this box. |
| addVFiller(vweight=...) | Add a vertical filler widget to this box. |
| childAt(x, y):abguibase.Widget | Get the child at a given point. |
| desiredSize() | [Inherited comment] Compute the desired size of this widget, including the insets. |
| fullDraw() | Draw this widget and all its children. |
| handled(event) | Handle an ui.cmd() event, or have a child handle it. |
| moveBy(dx, dy) | Move this widget and all its children by a vector. |
| remove(w:abguibase.Widget) | Remove a child widget from this box. |
| setAlpha(alpha) | Set the alpha on this box and all its children. |
| setRect(x, y, w=..., h=...) | Set this widget's rectangle, i.e. lay it and its children out on the canvas. |
| validate() | Validate this widget and all its children. |
A box lays its widgets out in a grid of rows with a predefined number of columns. The width of the columns and height of the rows depends on the desired size of the children they contain. Extra space is distributed among the columns and rows, missing space is taken away. The horizontal and vertical weight of each child when added via add() determines how much of the extra or missing space is assigned to it.
Between rows and columns there is a configurable Box.gap of a fixed number of pixels. It defaults to 1. Note that the Widget.inset for boxes defaults to 0.