aboutsummaryrefslogtreecommitdiff
path: root/examples/hello-world
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2025-04-29 12:30:21 +0200
committerFelix Morgner <felix.morgner@gmail.com>2025-04-29 12:32:34 +0200
commit673e58ca36421bb560d4e04277b6b58ce6e0db6f (patch)
tree4688e5b25a4bceac10c38a9ef0dc966d8f5131c2 /examples/hello-world
parent68b3389d282284a59329c9c6a6603c7045a2db72 (diff)
downloadlibadwaitamm-673e58ca36421bb560d4e04277b6b58ce6e0db6f.tar.xz
libadwaitamm-673e58ca36421bb560d4e04277b6b58ce6e0db6f.zip
adw: implement ToolbarView
Diffstat (limited to 'examples/hello-world')
-rw-r--r--examples/hello-world/hello.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/hello-world/hello.cpp b/examples/hello-world/hello.cpp
index dd8aa56..5351370 100644
--- a/examples/hello-world/hello.cpp
+++ b/examples/hello-world/hello.cpp
@@ -1,5 +1,7 @@
#include <adwaitamm/adwaitamm.hpp>
+#include <gtkmm.h>
+
auto main(int argc, char ** argv) -> int
{
auto app = Adwaita::Application::create("org.example.Hello");
@@ -8,6 +10,14 @@ auto main(int argc, char ** argv) -> int
auto window = new Adwaita::ApplicationWindow{app};
app->signal_shutdown().connect([window] { delete window; });
+ window->set_title("Hello");
+
+ auto toolbar_view = Adwaita::ToolbarView{};
+ auto label = Gtk::Label{"Hello World"};
+
+ toolbar_view.set_content(label);
+
+ window->set_content(toolbar_view);
window->present();
});