From 981886d79ba30ae03b11661ddd299815ca07a29b Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Fri, 14 Jun 2024 07:48:24 +0200 Subject: [PATCH] TROIS BOUTONS: STATE, RULES et DATA in a radio group (cleaning) --- callback.c | 1 - contain.c | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/callback.c b/callback.c index a10dda6..243ac7b 100644 --- a/callback.c +++ b/callback.c @@ -167,7 +167,6 @@ void on_axis_value_change(GtkAdjustment *adjustment, gpointer data) /* B U T T O N S */ /******************************************************************************/ void on_toggle_model_exec (GtkWidget *btt_run_stop_model_exec, gpointer data) {} -void on_toggle_observ_interpret (GtkWidget *btt_toggle_observ_interpret, gpointer data) {} void on_toggle_exec_edit (GtkWidget *btt_exec_xor_edit, GtkWidget *btt_run_stop_model_exec) { // gtk_button_set_icon_name (GTK_BUTTON (btt_exec_xor_edit), "power-profile-balanced-rtl-symbolic"); // gtk_button_set_label (GTK_BUTTON (btt_run_stop_model_exec), " run "); diff --git a/contain.c b/contain.c index be3dfc1..2d6515b 100644 --- a/contain.c +++ b/contain.c @@ -177,14 +177,21 @@ void window_header_bar (GtkWindow *window, char *title){ GtkButton *run_stop_model_exec = GTK_BUTTON (gtk_button_new_with_label (" run ")); g_signal_connect (run_stop_model_exec, "clicked", G_CALLBACK (on_toggle_model_exec), no_local_data); - GtkButton *btt_open_STATE = GTK_BUTTON (gtk_button_new_with_label ("state")); - g_signal_connect (btt_open_STATE, "clicked", G_CALLBACK (on_open_STATE), no_local_data); + GtkCheckButton *group_STATE_RULES_DATA = GTK_CHECK_BUTTON (gtk_check_button_new ()); - GtkButton *btt_open_RULES = GTK_BUTTON (gtk_button_new_with_label ("rules")); - g_signal_connect (btt_open_RULES, "clicked", G_CALLBACK (on_open_RULES), no_local_data); + GtkButton *btt_open_STATE = GTK_BUTTON (gtk_check_button_new_with_label ("state")); + g_signal_connect (btt_open_STATE, "toggled", G_CALLBACK (on_open_STATE), no_local_data); + gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_STATE), group_STATE_RULES_DATA); - GtkButton *btt_open_DATA = GTK_BUTTON (gtk_button_new_with_label ("data analysis")); - g_signal_connect (btt_open_DATA, "clicked", G_CALLBACK (on_open_DATA), no_local_data); + GtkButton *btt_open_RULES = GTK_BUTTON (gtk_check_button_new_with_label ("rules")); + g_signal_connect (btt_open_RULES, "toggled", G_CALLBACK (on_open_RULES), no_local_data); + gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_RULES), group_STATE_RULES_DATA); + + GtkButton *btt_open_DATA = GTK_BUTTON (gtk_check_button_new_with_label ("data analysis")); + 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); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (exec_xor_edit)); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (run_stop_model_exec));