Class: FakeEvent

Inherits:
Object show all
Defined in:
plugins/application/features/support/fake_event.rb

Instance Method Summary (collapse)

Constructor Details

- (FakeEvent) initialize(event_type, widget, options = {})

A new instance of FakeEvent



4
5
6
7
8
9
10
11
12
13
# File 'plugins/application/features/support/fake_event.rb', line 4

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