TermTk.TTkLayouts.layout

Layout [Tutorial]

TTkLayoutItem

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

TTkLayoutItem is the base class of layout Items inherited by TTkLayout, TTkWidgetItem, and all the derived layout managers.

Parameters
  • row (int) – (used only in the TTkGridLayout), the row of the grid, optional, defaults to None

  • col (int) – (used only in the TTkGridLayout), the col of the grid, optional, defaults to None

  • rowspan (int) – (used only in the TTkGridLayout), the rows used by this, optional, defaults to 1

  • colspan (int) – (used only in the TTkGridLayout), the cols used by this, optional, defaults to 1

  • layoutItemType (LayoutItemTypes) – The Type of this class, optional, defaults to TTkK.NONE

  • alignment (Alignment) – The alignment of this item in the layout (not yet used)

layer()[source]
parent()[source]
setGeometry(x, y, w, h)[source]
setLayer(layer)[source]
setOffset(x, y)[source]
setParent(parent)[source]

TTkLayout

class TTkLayout(*args, **kwargs)[source]
The TTkLayout class is the base class of geometry managers. <br/>
It allows free placement of the widgets in the layout area. <br/>
Used mainly to have free range moving TTkWindow because the widgets are not automatically rearranged after a layout event
╔════════════════════════════╗
║   pos(4,2)                 ║
║   ┌───────┐   pos(16,4)    ║
║   │Widget1│   ┌─────────┐  ║
║   │       │   │ Widget2 │  ║
║   │       │   └─────────┘  ║
║   │       │                ║
║   └───────┘                ║
║                            ║
╚════════════════════════════╝
addWidget(widget)[source]

Add a widget to this Layout

Parameters

widget (TTkWidgets) – the widget to be added

addWidgets(widgets)[source]

Add a list of widgets to this Layout

Parameters

widgets (list of TTkWidgets) – the widget to be added

insertWidget(index, widget)[source]
insertWidgets(index, widgets)[source]
layer()
lowerWidget(widget)[source]
parent()
raiseWidget(widget)[source]
removeItem(item)[source]
removeItems(items)[source]
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)[source]
setLayer(layer)
setOffset(x, y)
setParent(parent)[source]

TTkWidgetItem

class TTkWidgetItem(*args, **kwargs)[source]
layer()
parent()
setGeometry(x, y, w, h)[source]
setLayer(layer)
setOffset(x, y)
setParent(parent)