Skip to content

refactor: investigate remove layout #645

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions