From 53f2fea60c67965cb3b2c7d46efadc78240e3462 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Mon, 17 Jun 2024 21:24:24 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20on=20repart=20du=20'design'=20de=20la=20?= =?UTF-8?q?barre=20de=20titre=20simplifi=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contain.c | 42 ++++++++---------------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) diff --git a/contain.c b/contain.c index 40328c4..bbfe4b6 100644 --- a/contain.c +++ b/contain.c @@ -182,24 +182,16 @@ void window_header_bar (GtkWindow *window, char *title){ GtkCheckButton *group_STATE_RULES_DATA = GTK_CHECK_BUTTON (gtk_check_button_new ()); gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_STATE), group_STATE_RULES_DATA); gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_RULES), group_STATE_RULES_DATA); - gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_DATA), group_STATE_RULES_DATA); - - int selected = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (btt_open_STATE)); - printf("%d\n", selected); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (btt_open_STATE))) - g_signal_connect (btt_open_STATE, "toggled", G_CALLBACK (on_open_STATE), NULL); - else - g_signal_connect (btt_open_STATE, "toggled", G_CALLBACK (on_open_STATE), NULL); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (btt_open_RULES))) - g_signal_connect (btt_open_RULES, "toggled", G_CALLBACK (on_open_RULES), NULL); - else - g_signal_connect (btt_open_RULES, "toggled", G_CALLBACK (on_open_RULES), NULL); - - g_signal_connect (btt_open_DATA, "toggled", G_CALLBACK (on_open_DATA), no_local_data); + gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_DATA), group_STATE_RULES_DATA); gtk_check_button_set_active (GTK_CHECK_BUTTON (btt_open_STATE), TRUE); +// int selected = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (btt_open_STATE)); +// if (0) printf("%d\n", selected); +// if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (btt_open_STATE))) + +// g_signal_connect (btt_open_STATE, "toggled", G_CALLBACK (on_open_STATE), no_local_data); +// g_signal_connect (btt_open_RULES, "toggled", G_CALLBACK (on_open_RULES), no_local_data); +// g_signal_connect (btt_open_DATA, "toggled", G_CALLBACK (on_open_DATA), no_local_data); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_XOR_EXEC_EDIT)); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_MODEL_RUN_STOP)); @@ -211,24 +203,6 @@ void window_header_bar (GtkWindow *window, char *title){ icons_for_fun (GTK_HEADER_BAR (header_bar)); // https://iconduck.com/sets/adwaita-icon-theme } -static void output_state (GtkToggleButton *source, gpointer user_data) { - g_print ("Toggle button %s is active: %s\n", - gtk_button_get_label (GTK_BUTTON (source)), - gtk_toggle_button_get_active (source) ? "Yes" : "No"); - - -} - -static void make_toggles (void) { - GtkWidget *toggle1, *toggle2; - - toggle1 = gtk_toggle_button_new_with_label ("Hi, I’m toggle button one"); - g_signal_connect (toggle1, "toggled", G_CALLBACK (output_state), NULL); - - toggle2 = gtk_toggle_button_new_with_label ("Hi, I’m toggle button two"); - g_signal_connect (toggle2, "toggled", G_CALLBACK (output_state), NULL); -} - void window_main_child (GtkWindow *main_window, int selected_page){ /* switch (selected_page) {