summaryrefslogtreecommitdiff
path: root/gr-wxgui/src/python
diff options
context:
space:
mode:
Diffstat (limited to 'gr-wxgui/src/python')
-rw-r--r--gr-wxgui/src/python/gui.py9
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()