From 52053f917c9bc9f1c77db4019169945437f9cc02 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sun, 26 May 2024 08:21:47 +0200 Subject: [PATCH] learn gtk_widget_class_bind_template_callback() ? (windows.c line 78) --- src/ui/gemgraph.ui | 4 ++-- src/ui/window.c | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ui/gemgraph.ui b/src/ui/gemgraph.ui index 22b8dc0..31fe3e1 100644 --- a/src/ui/gemgraph.ui +++ b/src/ui/gemgraph.ui @@ -3,7 +3,7 @@ - +
diff --git a/src/ui/window.c b/src/ui/window.c index 1535a60..6192a30 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -75,6 +75,10 @@ static void gem_graph_client_window_class_init(GemGraphClientWindowClass *klass) bytes = g_bytes_new_take(contents, len); gtk_widget_class_set_template(GTK_WIDGET_CLASS(klass), bytes); + // https://docs.gtk.org/gtk4/class.Widget.html#building-composite-widgets-from-template-xml TODO Learn ! + // gtk_widget_class_bind_template_callback_full (GtkToggleButton, ui_toggle_sidebar, "clicked"); // "main_button_sidebar" + + gtk_widget_class_bind_template_child(widget_class, GemGraphClientWindow, main_titlebar); gtk_widget_class_bind_template_child(widget_class, GemGraphClientWindow, main_stack); gtk_widget_class_bind_template_child(widget_class, GemGraphClientWindow, side_stack); @@ -97,6 +101,9 @@ static void gem_graph_client_window_init(GemGraphClientWindow *self) window = self; } +// https://docs.gtk.org/gtk4/class.Widget.html#building-composite-widgets-from-template-xml +static void gtk_widget_class_dispose_template() {} // TODO ? + /* -------------------------------------------------------------------------- */ void ui_set_stack(int mode)