lib/glimmer/swt/shell_proxy.rb in glimmer-dsl-swt-4.18.3.2 vs lib/glimmer/swt/shell_proxy.rb in glimmer-dsl-swt-4.18.3.3
- old
+ new
@@ -122,11 +122,17 @@
def disposed?
swt_widget.isDisposed
end
alias disposed disposed?
+ # Hides shell. Automatically checks if widget is disposed to avoid crashing.
def hide
- @swt_widget.setVisible(false)
+ @swt_widget.setVisible(false) unless @swt_widget.isDisposed
+ end
+
+ # Closes shell. Automatically checks if widget is disposed to avoid crashing.
+ def close
+ @swt_widget.close unless @swt_widget.isDisposed
end
def visible?
@swt_widget.isDisposed ? false : @swt_widget.isVisible
end