Ver Fonte

*** empty log message ***

Mark Mine há 25 anos atrás
pai
commit
25813ab221

+ 0 - 3
direct/src/tkpanels/DirectSessionPanel.py

@@ -570,9 +570,6 @@ class DirectSessionPanel(AppShell):
         # Create some buttons in the bottom tray
         # Create some buttons in the bottom tray
         self.createButtons()
         self.createButtons()
 
 
-        # Clean up things when you destroy the panel
-        interior.bind('<Destroy>', self.onDestroy)
-
     def createButtons(self):
     def createButtons(self):
         # Grid: enable/disable, xyz/hpr snap, snap to plane
         # Grid: enable/disable, xyz/hpr snap, snap to plane
         # Render mode: wireframe, lights, texture
         # Render mode: wireframe, lights, texture

+ 7 - 0
direct/src/tkpanels/FSMInspector.py

@@ -279,6 +279,12 @@ class FSMInspector(AppShell):
         else:
         else:
             self.balloon.configure(state = 'none')
             self.balloon.configure(state = 'none')
             
             
+    def onDestroy(self, event):
+        """ Called on FSM Panel shutdown """
+        for si in self.stateInspectorDict.values():
+            self.ignore(self.name + '_' + si.getName() + '_entered')
+            self.ignore(self.name + '_' + si.getName() + '_exited')
+            
 class StateInspector(Pmw.MegaArchetype):
 class StateInspector(Pmw.MegaArchetype):
     def __init__(self, inspector, state, **kw):
     def __init__(self, inspector, state, **kw):
 
 
@@ -433,6 +439,7 @@ class StateInspector(Pmw.MegaArchetype):
     def exitedState(self):
     def exitedState(self):
         self._canvas.itemconfigure(self.marker, fill = 'CornflowerBlue')
         self._canvas.itemconfigure(self.marker, fill = 'CornflowerBlue')
 
 
+
 """
 """
 # USING FINITE STATE INSPECTOR
 # USING FINITE STATE INSPECTOR
 
 

+ 0 - 5
direct/src/tkpanels/MopathRecorder.py

@@ -162,11 +162,6 @@ class MopathRecorder(AppShell, PandaObject):
             self.accept(event, method)
             self.accept(event, method)
 
 
     def createInterface(self):
     def createInterface(self):
-        # The interior of the toplevel panel
-        interior = self.interior()
-        # Clean up things when you destroy the panel
-        interior.bind('<Destroy>', self.onDestroy)
-
         # FILE MENU
         # FILE MENU
         # Get a handle on the file menu so commands can be inserted
         # Get a handle on the file menu so commands can be inserted
         # before quit item
         # before quit item

+ 0 - 3
direct/src/tkpanels/Placer.py

@@ -365,9 +365,6 @@ class Placer(AppShell):
         # Set up placer for inital node path
         # Set up placer for inital node path
         self.selectNodePathNamed('init')
         self.selectNodePathNamed('init')
 
 
-        # Clean up things when you destroy the panel
-        interior.bind('<Destroy>', self.onDestroy)
-
         self.createButtons()
         self.createButtons()
 
 
     def createButtons(self):
     def createButtons(self):

+ 6 - 0
direct/src/tkwidgets/AppShell.py

@@ -105,6 +105,8 @@ class AppShell(Pmw.MegaWidget, PandaObject):
         self.__createCommandArea()
         self.__createCommandArea()
         self.__createMessageBar()
         self.__createMessageBar()
         self.__createAboutBox()
         self.__createAboutBox()
+        # Add binding for panel cleanup code
+        self.interior().bind('<Destroy>', self.onDestroy)
         #
         #
         # Create the parts of the interface
         # Create the parts of the interface
         # which can be modified by subclasses
         # which can be modified by subclasses
@@ -232,6 +234,10 @@ class AppShell(Pmw.MegaWidget, PandaObject):
         # Override this method to create the interface for the app.
         # Override this method to create the interface for the app.
         pass
         pass
 
 
+    def onDestroy(self, event):
+        # Override this method with actions to be performed on panel shutdown
+        pass
+
     def createMenuBar(self):
     def createMenuBar(self):
         # Creates default menus.  Can be overridden or simply augmented
         # Creates default menus.  Can be overridden or simply augmented
         # Using button Add below
         # Using button Add below