Skip to content

Layout

GuiWidgetLayout

GuiWidgetLayout(
    title: str,
    *rows: Sequence[
        GuiWidget | GuiWidgetLayout | Sequence[GuiWidget | GuiWidgetLayout]
    ],
    spacing: int = 6
)

Layout for grouping and positioning widgets.

Parameters:

  • title (str) –

    Layout title in GUI

  • rows (Sequence[GuiWidget | GuiWidgetLayout | Sequence[GuiWidget | GuiWidgetLayout]], default: () ) –

    A tuple of items to put in a row. Items can be widgets, layouts or tuples of widgets or layouts. If item is a tuple it's a column of items inside the tuple.

  • spacing (int, default: 6 ) –

    space between layout items

Example

# 2 rows x 1 column
GuiWidgetLayout('2 x 1', row1_col1,
                         row2_col1)
# 1 row x 2 columns
GuiWidgetLayout('1 x 2', [row1_col1, row1_col2])
# 2 rows x 2 columns
GuiWidgetLayout('2 x 2', [row1_col1, row1_col2],
                         [row2_col1, row2_col2])
# 2 x 2 with second row span
GuiWidgetLayout('row span', [row1_col1, row1_col2],
                                  row2_span)
# 2 x 2 with column span
GuiWidgetLayout('column span', [col1_span, [row1_col2,
                                            row2_col2]])

Note

Calls can't be subscribed to GuiWidgetLayout. Pre-declare widgets and subscribe calls to them.