xtd 0.2.0
exception_box.cpp

demonstrates the use of xtd::forms::exception_box dialog.

Windows
exception_box_w.png

exception_box_wd.png
macOS
exception_box_m.png

exception_box_md.png
Gnome
exception_box_g.png

exception_box_gd.png
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/exception_box>
#include <xtd/forms/form>
#include <xtd/invalid_operation_exception>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Exception box 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) {
}
};
}
private:
};
auto main()->int {
application::run(form1 {});
}