From d78bdc0e1d7796a1ec950350984fc984b130450c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 22 Aug 2010 15:13:03 -0400 Subject: [PATCH] Update view menu checkbox on pane-close button activity. --- hooke/ui/gui/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hooke/ui/gui/__init__.py b/hooke/ui/gui/__init__.py index 7362010..fd502c0 100644 --- a/hooke/ui/gui/__init__.py +++ b/hooke/ui/gui/__init__.py @@ -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) -- 2.26.2