From 79395a40dffe25f195dd3203be7f67141be2b8b5 Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Mon, 23 Apr 2001 07:59:31 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/gui/OnscreenPanel.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/direct/src/gui/OnscreenPanel.py b/direct/src/gui/OnscreenPanel.py index bc40194066..b05c5fe110 100644 --- a/direct/src/gui/OnscreenPanel.py +++ b/direct/src/gui/OnscreenPanel.py @@ -29,8 +29,11 @@ def cleanupPanel(uniqueName): """ if OnscreenPanel.AllPanels.has_key(uniqueName): + # calling cleanup() will remove it out of the AllPanels dict + # This way it will get removed from the dict even it we did + # not clean it up using this interface (ie somebody called + # self.cleanup() directly OnscreenPanel.AllPanels[uniqueName].cleanup() - del OnscreenPanel.AllPanels[uniqueName] class OnscreenPanel(PandaObject.PandaObject, NodePath): @@ -189,6 +192,11 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath): if not self.isEmpty(): self.removeNode() + # Remove this panel out of the AllPanels list + uniqueName = self.getUniqueName() + if OnscreenPanel.AllPanels.has_key(uniqueName): + del OnscreenPanel.AllPanels[uniqueName] + self.panelSetup = 0 return 1