diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/hello-world/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | examples/hello-world/hello.cpp | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/examples/hello-world/CMakeLists.txt b/examples/hello-world/CMakeLists.txt new file mode 100644 index 0000000..8ad13e3 --- /dev/null +++ b/examples/hello-world/CMakeLists.txt @@ -0,0 +1,7 @@ +add_executable("hello" + "hello.cpp" +) + +target_link_libraries("hello" PRIVATE + "adwaitamm::adwaitamm" +)
\ No newline at end of file diff --git a/examples/hello-world/hello.cpp b/examples/hello-world/hello.cpp new file mode 100644 index 0000000..ddcbc7a --- /dev/null +++ b/examples/hello-world/hello.cpp @@ -0,0 +1,15 @@ +#include <adwaitamm/adwaitamm.hpp> + +auto main(int argc, char ** argv) -> int +{ + auto app = Adwaita::Application::create("org.example.Hello"); + + app->signal_activate().connect([app] { + auto window = new Adwaita::ApplicationWindow{*app}; + app->signal_shutdown().connect([window] { delete window; }); + + window->present(); + }); + + return app->run(argc, argv); +} |
