Remove/Destroy containers - doesn't properly handle children #75

Open
jarvisteach opened this Issue Dec 30, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@jarvisteach
Owner

jarvisteach commented Dec 30, 2016

If you call removeLabelFrame() to destroySubWindow()

The container (and its children) is destroyed fine, however the widgets it holds are left in the config dictionaries.

This generally doesn't cause a problem - but if they are later accessed (e.g. in a callback loop such as animation, via change language, or just be a standard user call) it's not possible to call functions on them as they've been destroyed.

So, when a container is removed/destroyed - need some way of removing all of its children form the config arrays...

@jarvisteach jarvisteach added the bug label Dec 30, 2016

@jarvisteach jarvisteach modified the milestone: 0.06 Feb 25, 2017

@jarvisteach jarvisteach self-assigned this Feb 25, 2017

jarvisteach added a commit that referenced this issue Apr 13, 2017

Functions to cleanse dictionaries (#75)
Introduced functions to hunt down widgets & cleanse them from config
dictionaries.

This is used by destroy SubWindow.

Also a change to how modal is detected/turned on/off
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Apr 13, 2017

Owner

Added attempt to cleanse widgets when a SubWindow is destroyed.

Convoluted, have to hunt down the widget type, find its ID, use that to get its dictionary, then hunt through the dictionary to find the widget.

Not all widgets are in the ID dictionary (WIDGETS) - so had to be done manually.

Will raise a separate issue, to discuss changing how this is all managed.

Owner

jarvisteach commented Apr 13, 2017

Added attempt to cleanse widgets when a SubWindow is destroyed.

Convoluted, have to hunt down the widget type, find its ID, use that to get its dictionary, then hunt through the dictionary to find the widget.

Not all widgets are in the ID dictionary (WIDGETS) - so had to be done manually.

Will raise a separate issue, to discuss changing how this is all managed.

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Apr 13, 2017

Owner

Putting this issue on hold, until after #147 is resolved.

When a widget is removed, it needs to go through the same process as above.

This also needs to check variables are removed, event loops are removed, etc.

Owner

jarvisteach commented Apr 13, 2017

Putting this issue on hold, until after #147 is resolved.

When a widget is removed, it needs to go through the same process as above.

This also needs to check variables are removed, event loops are removed, etc.

@jarvisteach jarvisteach removed this from the 0.06 milestone Apr 13, 2017

@jarvisteach jarvisteach added the delayed label Apr 13, 2017

jarvisteach added a commit that referenced this issue Apr 14, 2017

@jarvisteach jarvisteach added this to the 1.0 milestone May 29, 2017

@jcolom64

This comment has been minimized.

Show comment
Hide comment
@jcolom64

jcolom64 Jun 7, 2017

From what I can tell, this will also impact removeTabbedFrame. If you create a TabbedFrame with one Tab named "A", then remove the frame by calling removeTabbedFrame, the frame and widgets are removed. But then, if you try to recreate the TabbedFrame with the same Tab "A" you will get the exception: Duplicate tabName: A. As far as I can tell, the problem is that the widgetStore still contain Tab "A".

jcolom64 commented Jun 7, 2017

From what I can tell, this will also impact removeTabbedFrame. If you create a TabbedFrame with one Tab named "A", then remove the frame by calling removeTabbedFrame, the frame and widgets are removed. But then, if you try to recreate the TabbedFrame with the same Tab "A" you will get the exception: Duplicate tabName: A. As far as I can tell, the problem is that the widgetStore still contain Tab "A".

@jarvisteach jarvisteach removed the delayed label Feb 15, 2018

jarvisteach added a commit that referenced this issue Mar 18, 2018

Can now remove tabs cleanly #75
Any widgets in the tab will be cleansed

jarvisteach added a commit that referenced this issue Mar 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment