xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
exception_dialog.cpp

The following code example demonstrate the use of exception_dialog dialog.

Windows
exception_dialog_w.png

exception_dialog_wd.png
macOS
exception_dialog_m.png

exception_dialog_md.png
Gnome
exception_dialog_g.png

exception_dialog_gd.png
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Exception dialog example");
controls().push_back(button1);
button1.location({10, 10});
button1.auto_size(true);
button1.text("Exception...");
button1.click += [&] {
try{
throw invalid_operation_exception("Throws an invalid operation exception to show an exception dialog.", current_stack_frame_);
} catch(const xtd::system_exception& e) {
dialog.exception(e);
}
};
}
private:
};
int main() {
application::run(form1());
}