TROIS BOUTONS: STATE, RULES et DATA

This commit is contained in:
Jean Sirmai 2024-06-14 07:20:01 +02:00
parent 83c3254732
commit 4cd7a0215a
Signed by: jean
GPG Key ID: FB3115C340E057E3
3 changed files with 17 additions and 27 deletions

View File

@ -175,25 +175,9 @@ void on_toggle_exec_edit (GtkWidget *btt_exec_xor_edit, GtkWidget *btt_run_stop_
}
void on_toggle_STATE_RULES (GtkWidget *btt_toggle_STATE_RULES, gpointer data)
{
const char* current_label = gtk_button_get_label (GTK_BUTTON (btt_toggle_STATE_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), "state");
window_main_child (main_window, 1);
}
else if (! strcmp (current_label, "state")) {
gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES), "rules");
window_main_child (main_window, 0);
}
}
void on_toggle_ANALYSIS (GtkWidget *btt_toggle_ANALYSIS, gpointer data)
{
window_main_child (main_window, 2);
}
void on_open_STATE (GtkWidget *btt_open_STATE, gpointer data) {window_main_child (main_window, 0);}
void on_open_RULES (GtkWidget *btt_open_RULES, gpointer data) {window_main_child (main_window, 1);}
void on_open_DATA (GtkWidget *btt_open_DATA, gpointer data) {window_main_child (main_window, 2);}
void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data) {
gtk_widget_set_sensitive (GTK_WIDGET (data), TRUE);

View File

@ -16,8 +16,10 @@ void on_axis_value_change (GtkAdjustment *adjustment, gpointer data);
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_STATE_RULES (GtkWidget *btt_toggle_STATE_RULES_DATA, gpointer data);
void on_toggle_ANALYSIS (GtkWidget *btt_toggle_ANALYSIS, gpointer data);
void on_open_STATE (GtkWidget *btt_open_STATE, gpointer data);
void on_open_RULES (GtkWidget *btt_open_RULES, gpointer data);
void on_open_DATA (GtkWidget *btt_open_DATA, gpointer data);
void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data);
void on_DISCARD_CURRENT_MODEL_AND_START_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data);

View File

@ -177,17 +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_toggle_STATE_RULES = GTK_BUTTON (gtk_button_new_with_label ("rules"));
g_signal_connect (btt_toggle_STATE_RULES, "clicked", G_CALLBACK (on_toggle_STATE_RULES), 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);
GtkButton *btt_toggle_ANALYSIS = GTK_BUTTON (gtk_button_new_with_label ("data analysis"));
g_signal_connect (btt_toggle_ANALYSIS, "clicked", G_CALLBACK (on_toggle_ANALYSIS), btt_toggle_STATE_RULES);
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_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);
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));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (any_Label));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_toggle_STATE_RULES));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_toggle_ANALYSIS));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_STATE));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_RULES));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_DATA));
icons_for_fun (GTK_HEADER_BAR (header_bar)); // https://iconduck.com/sets/adwaita-icon-theme
}