on_close
The on_close
method defines callback behavior that is triggered when a Window
is closed/destroyed. It generates a CrystGLFW::Event::WindowClose
that is yielded to the block:
window = Window.new
window.on_close do |event|
puts "Bye!"
end
With this callback defined, when the window
is closed, it will print "Bye!" to standard output.
on_close
must be called from within a run
block definition.