lib/glimmer/swt/message_box_proxy.rb in glimmer-dsl-swt-4.18.4.11 vs lib/glimmer/swt/message_box_proxy.rb in glimmer-dsl-swt-4.18.5.0
- old
+ new
@@ -40,12 +40,14 @@
end
@swt_widget = MessageBox.new(parent, style)
end
def open
- @swt_widget.open.tap do |result|
- @temporary_parent&.dispose
+ DisplayProxy.instance.auto_exec do
+ @swt_widget.open.tap do |result|
+ @temporary_parent&.dispose
+ end
end
end
def content(&block)
Glimmer::DSL::Engine.add_content(self, Glimmer::DSL::SWT::MessageBoxExpression.new, &block)
@@ -64,21 +66,32 @@
def has_attribute?(attribute_name, *args)
@swt_widget.respond_to?(attribute_setter(attribute_name), args)
end
def set_attribute(attribute_name, *args)
- @swt_widget.send(attribute_setter(attribute_name), *args) unless @swt_widget.send(attribute_getter(attribute_name)) == args.first
+ DisplayProxy.instance.auto_exec do
+ @swt_widget.send(attribute_setter(attribute_name), *args) unless @swt_widget.send(attribute_getter(attribute_name)) == args.first
+ end
end
def get_attribute(attribute_name)
- @swt_widget.send(attribute_getter(attribute_name))
+ DisplayProxy.instance.auto_exec do
+ @swt_widget.send(attribute_getter(attribute_name))
+ end
end
def method_missing(method, *args, &block)
- swt_widget.send(method, *args, &block)
+ DisplayProxy.instance.auto_exec do
+ swt_widget.send(method, *args, &block)
+ end
rescue => e
- Glimmer::Config.logger.debug {"Neither MessageBoxProxy nor #{swt_widget.class.name} can handle the method ##{method}"}
- super
+ begin
+ super
+ rescue Exception => inner_error
+ Glimmer::Config.logger.error {"Neither MessageBoxProxy nor #{swt_widget.class.name} can handle the method ##{method}"}
+ Glimmer::Config.logger.error {e.full_message}
+ raise inner_error
+ end
end
def respond_to?(method, *args, &block)
super ||
swt_widget.respond_to?(method, *args, &block)