Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove/Destroy containers - doesn't properly handle children #75
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...
added a commit
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.
added a commit
Apr 14, 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".