TermTk.TTkLayouts.boxlayout

Box Layout [Tutorial]

TTkHBoxLayout

class TTkHBoxLayout(*args, **kwargs)[source]

The TTkHBoxLayout class lines up widgets horizontally

TTkHBoxLayout
 ╔═════════╤═════════╤═════════╗
 ║ Widget1 │ Widget2 │ Widget3 ║
 ║         │         │         ║
 ║         │         │         ║
 ║         │         │         ║
 ║         │         │         ║
 ║         │         │         ║
 ╚═════════╧═════════╧═════════╝
addItem(item, row=None, col=None, rowspan=1, colspan=1, direction=3)

Add the item to this TTkGridLayout

Parameters
  • item (TTkLayoutItem) – the item to be added

  • row (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 to HORIZONTAL

addItems(items, row=None, col=None, rowspan=1, colspan=1, direction=3)

Add the items to this TTkGridLayout

Parameters
  • items (list of TTkLayoutItem) – the items to be added

  • row (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 to HORIZONTAL

addWidget(widget, row=None, col=None, rowspan=1, colspan=1, direction=3)

Add the widget to this TTkGridLayout, this function uses addItem()

Parameters
  • widget (TTkWidget) – the widget to be added

  • row (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 to HORIZONTAL

addWidgets(widgets, row=None, col=None, rowspan=1, colspan=1, direction=3)

Add the widgets to this TTkGridLayout, this function uses addItem()

Parameters
  • widgets (list of TTkWidget) – the widgets to be added

  • row (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 to HORIZONTAL

insertWidget(index, widget)
insertWidgets(index, widgets)
layer()
lowerWidget(widget)
maximumHeight() int

process the widgets and get the min size

maximumWidth() int

process the widgets and get the min size

minimumHeight() int

process the widgets and get the min size

minimumWidth() int

process the widgets and get the min size

parent()
raiseWidget(widget)
removeItem(item)
removeItems(items)
removeWidget(widget)

Remove a widget from this Layout

Parameters

widget (TTkWidgets) – the widget to be removed

removeWidgets(widgets)

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)

TTkVBoxLayout

class TTkVBoxLayout(*args, **kwargs)[source]

The TTkVBoxLayout class lines up widgets vertically

TTkVBoxLayout
 ╔═════════════════════════════╗
 ║         Widget 1            ║
 ╟─────────────────────────────╢
 ║         Widget 2            ║
 ╟─────────────────────────────╢
 ║         Widget 3            ║
 ╟─────────────────────────────╢
 ║         Widget 4            ║
 ╚═════════════════════════════╝
addItem(item)[source]

Add the item to this TTkGridLayout

Parameters
  • item (TTkLayoutItem) – the item to be added

  • row (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 to HORIZONTAL

addItems(items)[source]

Add the items to this TTkGridLayout

Parameters
  • items (list of TTkLayoutItem) – the items to be added

  • row (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 to HORIZONTAL

addWidget(widget)[source]

Add the widget to this TTkGridLayout, this function uses addItem()

Parameters
  • widget (TTkWidget) – the widget to be added

  • row (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 to HORIZONTAL

addWidgets(widgets)[source]

Add the widgets to this TTkGridLayout, this function uses addItem()

Parameters
  • widgets (list of TTkWidget) – the widgets to be added

  • row (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 to HORIZONTAL

insertWidget(index, widget)
insertWidgets(index, widgets)
layer()
lowerWidget(widget)
maximumHeight() int

process the widgets and get the min size

maximumWidth() int

process the widgets and get the min size

minimumHeight() int

process the widgets and get the min size

minimumWidth() int

process the widgets and get the min size

parent()
raiseWidget(widget)
removeItem(item)
removeItems(items)
removeWidget(widget)

Remove a widget from this Layout

Parameters

widget (TTkWidgets) – the widget to be removed

removeWidgets(widgets)

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)