"remove from parent" call from an entry widget

Lets say that a widget can have a list view component and, at the same times, the list view contains entry widgets. Something like this:

(I know, the one in the picture it’s a dynamic entry box instead of a list view, but anyway) If I call the “remove from parent” from the “Create New” button at the bottom of the screenshot, it works flawlessly, but it doesn’t work if I call it from the entry widget button.

How can I remove the “main” widget from the viewport when clicking on an entry widget, please?

Add a reference to the main widget inside the entries and when clicked call remove from parent but execute it on the main widget reference.

Alternatively you can add an event dispatcher and call it when an entry is clicked, then have the main widget bind those events and remove itself when an entry is selected.

1 Like

I’ve tried, but had no idea how to reference it :sweat_smile:

“Get parent” and similar return None for me.

Finally.

“Get Outer Object” twice to get the reference to the main object, cast to the main object class, then “Remove from Parent”. Thanks a lot!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.