From 518176f53f5aef5e6dad3df37f5b86a7da3e0212 Mon Sep 17 00:00:00 2001 From: Abhishek Nath Date: Fri, 24 Apr 2009 01:07:59 +0000 Subject: [PATCH] AnimPanel Had no way of telling objects that it had been closed --- direct/src/tkpanels/AnimPanel.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/direct/src/tkpanels/AnimPanel.py b/direct/src/tkpanels/AnimPanel.py index 0d027d1f79..5e58dcc1be 100644 --- a/direct/src/tkpanels/AnimPanel.py +++ b/direct/src/tkpanels/AnimPanel.py @@ -56,7 +56,9 @@ class AnimPanel(AppShell): # Execute option callbacks - self.initialiseoptions(AnimPanel) + self.initialiseoptions(AnimPanel) + # We need to know when AnimPanel is closed + self.destroyCallBack = None def createInterface(self): # Handle to the toplevels interior @@ -176,7 +178,7 @@ class AnimPanel(AppShell): controlFrame.pack(fill = X) - def createActorControls(self): + def createActorControls(self): # Create a frame to hold all the actor controls self.actorFrame = Frame(self.interior()) # Create a control for each actor @@ -332,11 +334,16 @@ class AnimPanel(AppShell): def resetAllToEnd(self): for actorControl in self.actorControlList: - actorControl.resetToEnd() + actorControl.resetToEnd() + + def setDestroyCallBack(self, callBack): + self.destroyCallBack = callBack def destroy(self): # First clean up - taskMgr.remove(self.id + '_UpdateTask') + taskMgr.remove(self.id + '_UpdateTask') + self.destroyCallBack() + self.destroyCallBack = None AppShell.destroy(self) class ActorControl(Pmw.MegaWidget):