investigate line, removing self:
widget.parentWidget().layout().removeWidget(self)
in libs/pyTermTk/TermTk/TTkLayouts/layout.py
def insertItems(self, index, items):
'''Insert multiple items at ``index`` and re-parent them.
Widgets passed directly are converted to their associated
:py:class:`TTkWidgetItem` wrapper before insertion.
:param index: insertion index
:type index: int
:param items: items or widgets to insert
:type items: list
'''
for i,item in enumerate(items):
if not isinstance(widget:=item, TTkLayoutItem):
if widget.parentWidget() and widget.parentWidget().layout():
widget.parentWidget().layout().removeWidget(self)
item = widget.widgetItem()
items[i]=item
investigate line, removing
self:widget.parentWidget().layout().removeWidget(self)in
libs/pyTermTk/TermTk/TTkLayouts/layout.py