diff options
author | jblum | 2008-10-09 01:42:25 +0000 |
---|---|---|
committer | jblum | 2008-10-09 01:42:25 +0000 |
commit | 73f3c91a5ad2acbb9f32bd440f2d4ea9ab54ac08 (patch) | |
tree | 01ee01600897d56c4f58bcfe627e41d0d9621cab /gr-wxgui/src/python | |
parent | e06f06e37fdc65198c037ab92f669f3ce78949c9 (diff) | |
download | gnuradio-73f3c91a5ad2acbb9f32bd440f2d4ea9ab54ac08.tar.gz gnuradio-73f3c91a5ad2acbb9f32bd440f2d4ea9ab54ac08.tar.bz2 gnuradio-73f3c91a5ad2acbb9f32bd440f2d4ea9ab54ac08.zip |
proper custom wxPython event, in wxPython style
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9760 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-wxgui/src/python')
-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): """ |