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.