TermTk.TTkLayouts.gridlayout
Grid Layout [Tutorial]
TTkGridLayout
- class TTkGridLayout(*args, **kwargs)[source]
The grid layout allows an automatic place all the widgets in a grid, <br/> the empty rows/cols are resized to the “rowMinHeight,columnMinWidth” parameters
TTkGridLayout ┌┐ columnMinWidth ╔═════════╤═════════╤╤═════════╗ ║ Widget1 │ Widget2 ││ Widget3 ║ ║ (0,0) │ (0,1) ││ (0,3) ║ ╟─────────┼─────────┼┼─────────╢ ┐ rowMinHeight ╟─────────┼─────────┼┼─────────╢ ┘ ║ Widget4 │ ││ ║ ║ (2,0) │ ││ ║ ╟─────────┼─────────┼┼─────────╢ ║ │ ││ Widget5 ║ ║ │ ││ (3,3) ║ ╚═════════╧═════════╧╧═════════╝
- Parameters
columnMinWidth (int) – the minimum width of the column, optional, defaults to 0
rowMinHeight (int) – the minimum height of the column, optional, defaults to 0
- addItem(item, row=None, col=None, rowspan=1, colspan=1, direction=3)[source]
Add the item to this
TTkGridLayout
- Parameters
item (
TTkLayoutItem
) – the item to be addedrow (int) – the row of the grid, optional, defaults to None
col (int) – the col of the grid, optional, defaults to None
rowspan (int) – the rows used by the item, optional, defaults to 1
colspan (int) – the cols used by the item, optional, defaults to 1
direction (
Direction
) – The direction the new item will be added if row/col are not specified, defaults to defaults toHORIZONTAL
- addItems(items, row=None, col=None, rowspan=1, colspan=1, direction=3)[source]
Add the items to this
TTkGridLayout
- Parameters
items (list of
TTkLayoutItem
) – the items to be addedrow (int) – the row of the grid, optional, defaults to None
col (int) – the col of the grid, optional, defaults to None
rowspan (int) – the rows used by the item, optional, defaults to 1
colspan (int) – the cols used by the item, optional, defaults to 1
direction (
Direction
) – The direction the new items will be added if row/col are not specified, defaults to defaults toHORIZONTAL
- addWidget(widget, row=None, col=None, rowspan=1, colspan=1, direction=3)[source]
Add the widget to this
TTkGridLayout
, this function usesaddItem()
- Parameters
widget (
TTkWidget
) – the widget to be addedrow (int) – the row of the grid, optional, defaults to None
col (int) – the col of the grid, optional, defaults to None
rowspan (int) – the rows used by the widget, optional, defaults to 1
colspan (int) – the cols used by the widget, optional, defaults to 1
direction (
Direction
) – The direction the new item will be added if row/col are not specified, defaults to defaults toHORIZONTAL
- addWidgets(widgets, row=None, col=None, rowspan=1, colspan=1, direction=3)[source]
Add the widgets to this
TTkGridLayout
, this function usesaddItem()
- Parameters
widgets (list of
TTkWidget
) – the widgets to be addedrow (int) – the row of the grid, optional, defaults to None
col (int) – the col of the grid, optional, defaults to None
rowspan (int) – the rows used by the widget, optional, defaults to 1
colspan (int) – the cols used by the widget, optional, defaults to 1
direction (
Direction
) – The direction the new items will be added if row/col are not specified, defaults to defaults toHORIZONTAL
- insertWidget(index, widget)
- insertWidgets(index, widgets)
- layer()
- lowerWidget(widget)
- parent()
- raiseWidget(widget)
- removeWidget(widget)[source]
Remove a widget from this Layout
- Parameters
widget (
TTkWidgets
) – the widget to be removed
- removeWidgets(widgets)[source]
Remove a list of widget from this Layout
- Parameters
widgets (list of
TTkWidgets
) – the widget to be removed
- setGeometry(x, y, w, h)
- setLayer(layer)
- setOffset(x, y)
- setParent(parent)