From 48ecbf1162f9031ab7134bbb571efc345bc8d7bd Mon Sep 17 00:00:00 2001 From: jcorgan Date: Wed, 11 Mar 2009 20:52:08 +0000 Subject: [PATCH] Add shutdown hook git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10582 221aa14e-8319-0410-a670-987f0aec2ac5 --- gr-wxgui/src/python/gui.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gr-wxgui/src/python/gui.py b/gr-wxgui/src/python/gui.py index 9cb66c4a..2f59af59 100644 --- a/gr-wxgui/src/python/gui.py +++ b/gr-wxgui/src/python/gui.py @@ -52,6 +52,11 @@ class top_panel(wx.Panel): self.SetAutoLayout(True) vbox.Fit(self) + def shutdown(self): + try: + self.gui.shutdown() + except AttributeError: + pass # # Top-level window frame with menu and status bars. @@ -91,6 +96,10 @@ class top_frame(wx.Frame): self.top_block.start() def OnCloseWindow(self, event): + # Give user API a chance to do something + self.panel.shutdown() + + # Stop flowgraph as a convenience self.SetStatusText("Ensuring flowgraph has completed before exiting...") if self.top_block is not None: self.top_block.stop() -- 2.47.2