diff options
Diffstat (limited to 'gr-wxgui/src')
-rw-r--r-- | gr-wxgui/src/python/common.py | 15 | ||||
-rw-r--r-- | gr-wxgui/src/python/number_window.py | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/gr-wxgui/src/python/common.py b/gr-wxgui/src/python/common.py index e54f4dbf1..f31e1a708 100644 --- a/gr-wxgui/src/python/common.py +++ b/gr-wxgui/src/python/common.py @@ -24,12 +24,6 @@ import numpy import math import wx -EVT_DATA = wx.NewEventType() -class DataEvent(wx.PyEvent): - def __init__(self, data): - wx.PyEvent.__init__(self, wx.NewId(), EVT_DATA) - self.data = data - class prop_setter(object): def _register_set_prop(self, controller, control_key, *args): def set_method(value): controller[control_key] = value @@ -37,6 +31,15 @@ class prop_setter(object): setattr(self, 'set_%s'%control_key, set_method) ################################################## +# Custom Data Event +################################################## +EVT_DATA = wx.PyEventBinder(wx.NewEventType()) +class DataEvent(wx.PyEvent): + def __init__(self, data): + wx.PyEvent.__init__(self, wx.NewId(), EVT_DATA.typeId) + self.data = data + +################################################## # Input Watcher Thread ################################################## class input_watcher(threading.Thread): diff --git a/gr-wxgui/src/python/number_window.py b/gr-wxgui/src/python/number_window.py index dbdb68120..e766c68c1 100644 --- a/gr-wxgui/src/python/number_window.py +++ b/gr-wxgui/src/python/number_window.py @@ -135,7 +135,7 @@ class number_window(wx.Panel, pubsub.pubsub, common.prop_setter): self._register_set_prop(self, RUNNING_KEY, True) #register events self.ext_controller.subscribe(msg_key, self.handle_msg) - self.Connect(wx.ID_ANY, wx.ID_ANY, common.EVT_DATA, self.update) + self.Bind(common.EVT_DATA, self.update) def show_gauges(self, show_gauge): """ |