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.
application_context.cpp

The following code example demonstrate the use of xtd::forms::application and xtd::forms::application_context classes.

Windows
application_context_w.png

application_context_wd.png
macOS
application_context_m.png

application_context_md.png
Gnome
application_context_g.png

application_context_gd.png
#include <xtd/xtd>
using namespace xtd::forms;
int main() {
form form1;
form1.click += [&] {
context.main_form(form1);
};
form1.text("Form 1 (Click the client area to set form as the main form)");
form1.show();
form form2;
form2.click += [&] {
context.main_form(form2);
};
form2.text("Form 2 (Click the client area to set form as the main form)");
form2.show();
form form3;
form3.click += [&] {
context.main_form(form3);
};
form3.text("Form 3 (Click the client area to set form as the main form)");
form3.show();
// if no client area form clicked, the application will not exit when you close the forms.
application::run(context);
}