Sha256: 85727f1da5a1ccbed0ae8a2185b507351f9851af2bc12d75c67ca5c5b550cefc
Contents?: true
Size: 653 Bytes
Versions: 38
Compression:
Stored size: 653 Bytes
Contents
require 'ostruct' class FakeEvent def initialize(event_type, widget, options = {}) untyped_event = Swt::Widgets::Event.new.tap do |e| e.display = Swt.display e.widget = widget e.x = options[:x] || 0 e.y = options[:y] || 0 e.button = options[:button] if options[:button] end widget.notify_listeners(event_type, untyped_event) end end class FakeKeyEvent def initialize(key_code, widget) event = Swt::Widgets::Event.new event.display = Swt.display event.widget = widget event.type = Swt::SWT::KeyDown event.keyCode = key_code widget.notify_listeners(event.type,event) end end
Version data entries
38 entries across 38 versions & 2 rubygems