diff options
author | jcorgan | 2009-03-11 20:52:08 +0000 |
---|---|---|
committer | jcorgan | 2009-03-11 20:52:08 +0000 |
commit | 48ecbf1162f9031ab7134bbb571efc345bc8d7bd (patch) | |
tree | 9340d506752ab83c2815bf99ad38a9aab35caaa5 /gr-wxgui/src/python | |
parent | ceca8e1482d9d4c93eecb279d2491186e4ad8076 (diff) | |
download | gnuradio-48ecbf1162f9031ab7134bbb571efc345bc8d7bd.tar.gz gnuradio-48ecbf1162f9031ab7134bbb571efc345bc8d7bd.tar.bz2 gnuradio-48ecbf1162f9031ab7134bbb571efc345bc8d7bd.zip |
Add shutdown hook
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10582 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-wxgui/src/python')
-rw-r--r-- | gr-wxgui/src/python/gui.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gr-wxgui/src/python/gui.py b/gr-wxgui/src/python/gui.py index 9cb66c4a1..2f59af593 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() |