Displaying 4 results from an estimated 4 matches for "event_class_for_typ".
Did you mean:
event_class_for_type
2008 May 14
0
[ wxruby-Patches-20130 ] Event handling performance issues
...7033 events/second and wxRuby with 39435 events/second. The script does not intend to have scientific rigor but it demonstrates what I meant.
The patch modifies mainly the behavior of wxRuby_WrapWxEventInRuby(). One of the great bottlenecks that I could find was the C++ code calling Wx::EvtHandler.event_class_for_type() on the ruby side every time a new event is generated. I modified it to directly access the Wx::EvtHandler::EVENT_TYPE_CLASS_MAP hash (and saving it in a global variable after the first lookup), leading to a great performance improvement.
Another minor change was in wxRbCallback::EventThunker, ju...
2007 Jun 28
0
[1092] trunk/wxruby2/swig/classes/App.i: Pass correctly typed Events into filter_event, if defined (bug 10797);
...sp                                rb_intern("event_class_for_type"),
+                                &...
2007 May 31
0
[1042] trunk/wxruby2: Overhaul of the event handling WxType->RubyClass mapping to make it
...p2007-05-31 21:19:45 UTC (rev 1042)
</span><span class="lines">@@ -0,0 +1,225 @@
</span><ins>+# All classes which are capable of handling events inherit from
+# EvtHandler. This includes all Wx::Window subclasses and Wx::App.
+
+class Wx::EvtHandler
+
+ def self.event_class_for_type(id)
+ if evt_klass = EVENT_TYPE_MAPPING[id]
+ return evt_klass
+ else
+ warn "No event class defined for event type #{id}"
+ return Wx::Event
+ end
+ end
+
+ # This has maps integer EventType ids from the Wx API to Ruby
+ # classes. It''s called interna...
2007 Jun 25
0
[1067] trunk/wxruby2: Set up event handlers in Ruby rather than by post-processing SWIG output
...t;+ # Given a Wx EventType id (eg Wx::EVT_MENU), returns a WxRuby Event
+ # class which should be passed to event handler blocks. The actual
+ # EVT_XXX constants themselves are in the compiled library, defined in
+ # swig/classes/Event.i
</ins><span class="cx"> def self.event_class_for_type(id)
</span><span class="cx"> if evt_klass = EVENT_TYPE_MAPPING[id]
</span><span class="cx"> return evt_klass
</span><span class="lines">@@ -12,215 +15,753 @@
</span><span class="cx"> end
</span...