Layout#
- class Layout#
Arranges the elements of a panel automatically, so that they do not have to be positioned one by one. See
Panel.add_horizontal_layout(),Panel.add_vertical_layout()andPanel.add_grid_layout().- spacing#
The gap left between the elements, in pixels. A grid layout uses it in both directions.
- Attribute:
Can be read or written
- Return type:
float
- padding#
The gap left inside the edges of the panel.
- Attribute:
Can be read or written
- Return type:
- child_alignment#
Where the elements are placed within the space the layout has to fill.
- Attribute:
Can be read or written
- Return type:
- cell_size#
The size of each cell of a grid layout, in pixels.
- Attribute:
Can be read or written
- Return type:
tuple(float, float)
Note
Only applies to a grid layout. Throws an exception for the other layouts, whose elements are sized individually using their layout elements.
- constraint#
What fixes the shape of a grid layout.
- Attribute:
Can be read or written
- Return type:
Note
Only applies to a grid layout. Throws an exception for the other layouts.
- constraint_count#
The number of columns or rows that
Layout.constraintfixes, ignored when the constraint isGridConstraint.flexible.- Attribute:
Can be read or written
- Return type:
int
Note
Only applies to a grid layout. Throws an exception for the other layouts.
- class Padding(left, right, top, bottom)#
The gap left inside each edge of a layout, in whole pixels.
Note
See
Layout.padding.- left#
The gap inside the left edge.
- Return type:
int
- right#
The gap inside the right edge.
- Return type:
int
- top#
The gap inside the top edge.
- Return type:
int
- bottom#
The gap inside the bottom edge.
- Return type:
int