diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-04-28 22:37:46 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-04-28 22:37:46 +0200 |
| commit | 0a85bb794df73906da2905c72e305e556e717a79 (patch) | |
| tree | 20053fd799492cd9ea71a01a36faf5b97c2d3db8 /examples | |
| parent | 1f7fb26ceaa5d05c4c62cc6d110d5344708ab468 (diff) | |
| download | libadwaitamm-0a85bb794df73906da2905c72e305e556e717a79.tar.xz libadwaitamm-0a85bb794df73906da2905c72e305e556e717a79.zip | |
demo: rename to hello-world example
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); +} |
