I'm working with FXRuby, and I'm trying to figure out how to have an error dialog box, similar to
JOptionPane.showMessageDialog(null, "Error", "Error!", JOptionPane.ERROR_MESSAGE);
in Java. The closest equivalent I have found is FXMessageBox.error
, however usage of this method is seemingly impossible. The documentation specifies the follow parameters in order, FXMessageBox.error(owner, opts, caption, message)
. I have tried this so far
app = FXApp.new
FXMessageBox.error(app, nil, 'Error', 'Error!')
However, it gives me the error
Wrong arguments for overloaded method 'FXMessageBox.error'.
When I try to do
FXMessageBox.error(app, FXMessageBox::MBOX_OK, 'Error', 'Error!')
I get
FXMessageBox::create: trying to create window before creating parent window.
How do I create the requested Error box?