commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r9760 - gnuradio/trunk/gr-wxgui/src/python


From: jblum
Subject: [Commit-gnuradio] r9760 - gnuradio/trunk/gr-wxgui/src/python
Date: Wed, 8 Oct 2008 19:42:27 -0600 (MDT)

Author: jblum
Date: 2008-10-08 19:42:25 -0600 (Wed, 08 Oct 2008)
New Revision: 9760

Modified:
   gnuradio/trunk/gr-wxgui/src/python/common.py
   gnuradio/trunk/gr-wxgui/src/python/number_window.py
Log:
proper custom wxPython event, in wxPython style

Modified: gnuradio/trunk/gr-wxgui/src/python/common.py
===================================================================
--- gnuradio/trunk/gr-wxgui/src/python/common.py        2008-10-09 00:03:45 UTC 
(rev 9759)
+++ gnuradio/trunk/gr-wxgui/src/python/common.py        2008-10-09 01:42:25 UTC 
(rev 9760)
@@ -24,12 +24,6 @@
 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 @@
                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):

Modified: gnuradio/trunk/gr-wxgui/src/python/number_window.py
===================================================================
--- gnuradio/trunk/gr-wxgui/src/python/number_window.py 2008-10-09 00:03:45 UTC 
(rev 9759)
+++ gnuradio/trunk/gr-wxgui/src/python/number_window.py 2008-10-09 01:42:25 UTC 
(rev 9760)
@@ -135,7 +135,7 @@
                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):
                """





reply via email to

[Prev in Thread] Current Thread [Next in Thread]