On 10/11/2014 08:20 PM, Marco Leise wrote:

I would like to present an error message when in my application's constructor a file cannot be loaded. So I wrote

auto dialog = scoped!MessageDialog(this, 0, GtkMessageType.ERROR, GtkButtonsType.CLOSE, `Could not load "` ~ filename ~ `": %s`, e.msg);
dialog.run();

(I assume I don't need flags because the MessageDialog is destroyed by scope on exit of scope and dialog.run() makes it modal.)
When the dialog comes up though, it cannot be closed by clicking on OK or pressing ⏎. What could it be?

You need to call dialog.destroy() when run returns to close the Dialog.

Some other things I noticed, maybe due to Gtk+3: There is no error icon and no title. There is no property for the secondary text.

You can use dialog.setTitle() to set a title.