From 00f88d1c36b717c101935e9c41811a6ef25e87c5 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Thu, 13 Jun 2024 09:48:21 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20une=20premi=C3=A8re=20approximation=20de?= =?UTF-8?q?=20la=20commutation=20:=20STATE=20/=20RULES=20/=20ANALYSE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- callback.c | 47 +++++++++++++++-------------------------------- contain.c | 2 +- contain.h | 1 + 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/callback.c b/callback.c index 53877c9..5052045 100644 --- a/callback.c +++ b/callback.c @@ -166,49 +166,32 @@ void on_axis_value_change(GtkAdjustment *adjustment, gpointer data) /******************************************************************************/ /* B U T T O N S */ /******************************************************************************/ -void on_toggle_exec_edit (GtkWidget *btt_exec_xor_edit, GtkWidget *btt_run_stop_model_exec) -{ +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 "); // gtk_widget_set_sensitive (GTK_WIDGET (btt_run_stop_model_exec), TRUE); - -// gtk_button_set_icon_name (GTK_BUTTON (btt_exec_xor_edit), "document-edit-symbolic"); -// gtk_button_set_icon_name (GTK_BUTTON (btt_exec_xor_edit), "text-editor-symbolic"); // I hesitate -// gtk_button_set_label (GTK_BUTTON (btt_run_stop_model_exec), " off "); -// gtk_widget_set_sensitive (GTK_WIDGET (btt_run_stop_model_exec), FALSE); } -void on_toggle_model_exec (GtkWidget *btt_run_stop_model_exec, gpointer data) -{ -// gtk_button_set_label (GTK_BUTTON (btt_run_stop_model_exec), " run "); -// gtk_button_set_label (GTK_BUTTON (btt_run_stop_model_exec), "stop"); -} void on_toggle_STATE_RULES_DATA (GtkWidget *btt_toggle_STATE_RULES_DATA, gpointer data) { const char* current_label = gtk_button_get_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA)); -// if (! strcmp (current_label, "rules")) printf ("callback.c (line 190) - strcomp +\n"); -// else printf ("callback.c (line 191) - strcomp -\n"); - -// if (! strcmp (current_label, "rules")) gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), "state"); -// else gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), "rules"); - if (0) printf ("callback.c (line 191) - current_label = %s\n", current_label); - if (! strcmp (current_label, " rules ")) gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), " state "); - else if (! strcmp (current_label, " state ")) gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), "analyse"); - else gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), " rules "); - - -// gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), "state"); -// gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), "rules"); -// gtk_window_present (dialog_window); -} - -void on_toggle_observ_interpret (GtkWidget *btt_toggle_observ_interpret, gpointer data) -{ -// gtk_button_set_label (GTK_BUTTON (btt_toggle_observ_interpret), "observe"); -// gtk_button_set_label (GTK_BUTTON (btt_toggle_observ_interpret), "interpret"); + if (! strcmp (current_label, "analyse")) { + gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), " state "); + window_main_child (main_window, 0); + } + else if (! strcmp (current_label, " state ")) { + gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), " rules "); + window_main_child (main_window, 1); + } + else { + gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), "analyse"); + window_main_child (main_window, 2); + } } void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data) { diff --git a/contain.c b/contain.c index f2ba5fc..32d8756 100644 --- a/contain.c +++ b/contain.c @@ -177,7 +177,7 @@ 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_toggle_STATE_RULES_DATA = GTK_BUTTON (gtk_button_new_with_label (" rules ")); + GtkButton *btt_toggle_STATE_RULES_DATA = GTK_BUTTON (gtk_button_new_with_label (" state ")); g_signal_connect (btt_toggle_STATE_RULES_DATA, "clicked", G_CALLBACK (on_toggle_STATE_RULES_DATA), no_local_data); // GtkButton *observ_interpret = GTK_BUTTON (gtk_button_new_with_label ("data analysis")); diff --git a/contain.h b/contain.h index 93ab316..3121b99 100644 --- a/contain.h +++ b/contain.h @@ -35,4 +35,5 @@ void two_notebooks_in_two_panes (GtkWindow *window); GtkWidget *get_selected_rules_vpaned_new(); GtkFrame *get_frame_with_label(); void window_main_child_bottom (GtkBox *page_box); +void window_main_child (GtkWindow *main_window, int selected_page);