mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
when destroying a gui object, properly destroy it's child gui objects
This commit is contained in:
parent
7d5656858f
commit
60b62dd82f
@ -1031,7 +1031,15 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
|
|||||||
# Destroy children
|
# Destroy children
|
||||||
for child in self.getChildrenAsList():
|
for child in self.getChildrenAsList():
|
||||||
childGui = self.guiDict.get(child.getName())
|
childGui = self.guiDict.get(child.getName())
|
||||||
if childGui: childGui.destroy()
|
if childGui:
|
||||||
|
childGui.destroy()
|
||||||
|
else:
|
||||||
|
# RAU since we added the class to the name, try
|
||||||
|
# it with the original name
|
||||||
|
parts = child.getName().split('-')
|
||||||
|
simpleChildGui = self.guiDict.get(parts[-1])
|
||||||
|
if simpleChildGui:
|
||||||
|
simpleChildGui.destroy()
|
||||||
# messenger.send(DESTROY + child.getName())
|
# messenger.send(DESTROY + child.getName())
|
||||||
del self.guiDict[self.guiId]
|
del self.guiDict[self.guiId]
|
||||||
del self.frameStyle
|
del self.frameStyle
|
||||||
|
Loading…
x
Reference in New Issue
Block a user