Update view menu checkbox on pane-close button activity.
authorW. Trevor King <wking@drexel.edu>
Sun, 22 Aug 2010 19:13:03 +0000 (15:13 -0400)
committerW. Trevor King <wking@drexel.edu>
Sun, 22 Aug 2010 19:13:03 +0000 (15:13 -0400)
hooke/ui/gui/__init__.py

index 7362010..fd502c0 100644 (file)
@@ -243,7 +243,7 @@ class HookeFrame (wx.Frame):
         self.Bind(wx.EVT_ERASE_BACKGROUND, self._on_erase_background)
         self.Bind(wx.EVT_SIZE, self._on_size)
         self.Bind(wx.EVT_CLOSE, self._on_close)
-        self.Bind(aui.EVT_AUI_PANE_CLOSE, self.OnPaneClose)
+        self.Bind(aui.EVT_AUI_PANE_CLOSE, self._on_pane_close)
         self.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self._on_notebook_page_close)
 
         return # TODO: cleanup
@@ -657,9 +657,6 @@ class HookeFrame (wx.Frame):
         playlist_name = ctrl.GetPageText(ctrl._curpage)
         self.DeleteFromPlaylists(playlist_name)
 
-    def OnPaneClose(self, event):
-        event.Skip()
-
     def OnPropGridChanged (self, event):
         prop = event.GetProperty()
         if prop:
@@ -857,6 +854,13 @@ class HookeFrame (wx.Frame):
 
     # Panel display handling
 
+    def _on_pane_close(self, event):
+        pane = event.pane
+        view = self._c['menu bar']._c['view']
+        if pane.name in  view._c.keys():
+            view._c[pane.name].Check(False)
+        event.Skip()
+
     def _on_panel_visibility(self, _class, method, panel_name, visible):
         pane = self._c['manager'].GetPane(panel_name)
         pane.Show(visible)