Sha256: 114ce0d165fcd4a93960b77e64d3fa701bab5c52a4acb9d19e472daf6f43b775

Contents?: true

Size: 468 Bytes

Versions: 1

Compression:

Stored size: 468 Bytes

Contents

$LOAD_PATH.unshift('lib')
require 'spyglass'

include Spyglass 

window  = GUI::Window.new "Original"
card    = Image.load File.expand_path('images/card.jpg', File.dirname(__FILE__))

window.on_click do |x, y|
  puts "CLICKED: #{ x }, #{ y }"
end

window.on_double_click do |x, y|
  puts "DOUBLE CLICKED: #{ x }, #{ y }"
end

window.on_right_click do |x, y|
  puts "RIGHT CLICKED: #{ x }, #{ y }"
end

window.show(card)

loop do
  break if GUI::wait_key(500) > 0
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spyglass-0.0.5.1 examples/window_events.rb