lib/swing_helpers.rb in sensible-cinema-0.16.3 vs lib/swing_helpers.rb in sensible-cinema-0.16.5
- old
+ new
@@ -6,20 +6,27 @@
include_package 'java.awt'
[FlowLayout, Font]
include_class java.awt.event.ActionListener
JFile = java.io.File
include_class java.awt.FileDialog
-
+ include_class java.lang.System
+
class JButton
def initialize *args
super *args
set_font Font.new("Tahoma", Font::PLAIN, 11)
end
def on_clicked &block
raise unless block
add_action_listener do |e|
- block.call
+ begin
+ block.call
+ rescue Exception => e
+ puts 'got fatal exception', e
+ puts e.backtrace.join("\n")
+ System.exit(1) # LODO no exit
+ end
end
self
end
end
\ No newline at end of file