TTkLayoutπΆοΈ
- class TTkLayout(**kwargs)[source]πΆοΈ
Bases:
TTkLayoutItemTheTTkLayoutclass 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 movingTTkWindowbecause the widgets are not automatically rearranged after a layout eventββββββββββββββββββββββββββββββ β pos(4,2) β β βββββββββ pos(16,4) β β βWidget1β βββββββββββ β β β β β Widget2 β β β β β βββββββββββ β β β β β β βββββββββ β β β ββββββββββββββββββββββββββββββ
MethodsπΆοΈ
- addItem(item)[source]πΆοΈ
Append a layout item.
- Parameters:
item (
TTkLayoutItem) β item to append
- addItems(items)[source]πΆοΈ
Append multiple layout items.
- Parameters:
items (list[
TTkLayoutItem]) β items to append
- 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
- fullWidgetAreaGeometry()[source]πΆοΈ
Return the bounding geometry that encloses all child items.
- Returns:
(x, y, width, height)bounding box- Return type:
tuple[int, int, int, int]
- insertItem(index, item)[source]πΆοΈ
Insert a single item at
index.- Parameters:
index (int) β insertion index
item (
TTkLayoutItem) β item to insert
- insertItems(index, items)[source]πΆοΈ
Insert multiple items at
indexand re-parent them.Widgets passed directly are converted to their associated
TTkWidgetItemwrapper before insertion.- Parameters:
index (int) β insertion index
items (list) β items or widgets to insert
- insertWidget(index, widget)[source]πΆοΈ
Insert a widget at
index.- Parameters:
index (int) β insertion index
widget (
TTkWidgets) β widget to insert
- insertWidgets(index, widgets)[source]πΆοΈ
Insert widgets at
index.- Parameters:
index (int) β insertion index
widgets (list of
TTkWidgets) β widgets to insert
- itemAt(index)[source]πΆοΈ
Return the item at
indexorNonewhen out of range.- Parameters:
index (int) β child index
- Returns:
the layout item at
indexif available- Return type:
TTkLayoutItemor None
- iterWidgets(onlyVisible: bool = True, recurse: bool = True, reverse: bool = False) Generator[TTkWidget, None, None][source]πΆοΈ
Iterate over all widgets in the layout.
- Parameters:
onlyVisible (bool) β if True, only yield visible widgets
recurse (bool) β if True, recursively iterate through nested layouts
reverse (bool) β if True, iterate in reverse order
- Returns:
generator yielding widgets
- Return type:
Generator[
TTkWidget, None, None]
- layoutItemType() LayoutItemTypes[source]πΆοΈ
Return
TTkK.LayoutItemTypes.LayoutItem.
- lowerWidget(widget)[source]πΆοΈ
Lower a widget (and its branch) to the bottom z-order.
- Parameters:
widget (
TTkWidget) β widget to lower
- parentWidget() TTkWidget | None[source]πΆοΈ
Return the widget owning this layout branch.
- Returns:
nearest parent widget in the hierarchy
- Return type:
TTkWidgetor None
- raiseWidget(widget)[source]πΆοΈ
Raise a widget (and its branch) to the top z-order.
- Parameters:
widget (
TTkWidget) β widget to raise
- removeItem(item)[source]πΆοΈ
Remove a single layout item.
- Parameters:
item (
TTkLayoutItem) β item to remove
- removeItems(items)[source]πΆοΈ
Remove a list of layout items if present.
- Parameters:
items (list[
TTkLayoutItem]) β items to remove
- 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
- replaceItem(item, index)[source]πΆοΈ
Replace the item at
indexwithitem.- Parameters:
item (
TTkLayoutItem) β replacement itemindex (int) β target index to replace
- Raises:
ValueError β if
indexis outside the valid range
- setGeometry(x, y, w, h)[source]πΆοΈ
Set layout geometry and propagate a layout update when changed.
- Parameters:
x (int) β horizontal position
y (int) β vertical position
w (int) β width
h (int) β height
TTkLayout AttributesπΆοΈ
|
|
|
|
|
|
|
|
|
|
|
Return child items sorted by z-order. |