From 0f0c21b299c7d2d79dc325346eba23d4235a373e Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sat, 15 Jun 2024 00:01:58 +0200 Subject: [PATCH] WIP: cleaning --- callback.c | 11 ++++++----- callback.h | 4 ++-- contain.c | 21 ++++++++++----------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/callback.c b/callback.c index 243ac7b..38992af 100644 --- a/callback.c +++ b/callback.c @@ -166,11 +166,12 @@ 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_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); +void on_toggle_MODEL_RUN_STOP (GtkWidget *btt_MODEL_RUN_STOP, gpointer data){} +void on_toggle_EXEC_EDIT (GtkWidget *btt_XOR_EXEC_EDIT, GtkWidget *btt_MODEL_RUN_STOP) { + gtk_button_set_icon_name (GTK_BUTTON (btt_XOR_EXEC_EDIT), "power-profile-balanced-rtl-symbolic"); + gtk_button_set_icon_name (GTK_BUTTON (btt_XOR_EXEC_EDIT), "preferences-system-symbolic"); + gtk_button_set_label (GTK_BUTTON (btt_MODEL_RUN_STOP), " run "); + gtk_widget_set_sensitive (GTK_WIDGET (btt_MODEL_RUN_STOP), TRUE); } diff --git a/callback.h b/callback.h index 1523c7d..ac26745 100644 --- a/callback.h +++ b/callback.h @@ -14,8 +14,8 @@ void on_glarea_unrealize (GtkWidget *widget); 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_EXEC_EDIT (GtkWidget *btt_XOR_EXEC_EDIT, GtkWidget *btt_MODEL_RUN_STOP); +void on_toggle_MODEL_RUN_STOP (GtkWidget *btt_MODEL_RUN_STOP, gpointer data); void on_open_STATE (GtkWidget *btt_open_STATE, gpointer data); void on_open_RULES (GtkWidget *btt_open_RULES, gpointer data); diff --git a/contain.c b/contain.c index 2d6515b..785400f 100644 --- a/contain.c +++ b/contain.c @@ -164,18 +164,17 @@ void window_header_bar (GtkWindow *window, char *title){ gpointer no_local_data = NULL; - GtkButton *exec_xor_edit = GTK_BUTTON (gtk_toggle_button_new ()); - gtk_button_set_icon_name (exec_xor_edit, "system-run-symbolic"); - gtk_button_set_icon_name (exec_xor_edit, "power-profile-balanced-rtl-symbolic"); -// g_signal_connect (exec_xor_edit, "clicked", G_CALLBACK (on_toggle_exec_edit), run_stop_model_exec); + GtkButton *btt_MODEL_RUN_STOP = GTK_BUTTON (gtk_button_new_with_label (" run ")); + g_signal_connect (btt_MODEL_RUN_STOP, "clicked", G_CALLBACK (on_toggle_MODEL_RUN_STOP), no_local_data); + + GtkButton *btt_XOR_EXEC_EDIT = GTK_BUTTON (gtk_toggle_button_new ()); + gtk_button_set_icon_name (btt_XOR_EXEC_EDIT, "system-run-symbolic"); + gtk_button_set_icon_name (btt_XOR_EXEC_EDIT, "power-profile-balanced-rtl-symbolic"); + g_signal_connect (btt_XOR_EXEC_EDIT, "clicked", G_CALLBACK (on_toggle_EXEC_EDIT), btt_MODEL_RUN_STOP); // GtkWidget* separe = gtk_separator_new (GTK_ORIENTATION_VERTICAL); // gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (separe)); - - GtkWidget *any_Label = GTK_WIDGET (gtk_label_new ("------------")); - - 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); + GtkWidget *any_Label = GTK_WIDGET (gtk_label_new (" | ")); GtkCheckButton *group_STATE_RULES_DATA = GTK_CHECK_BUTTON (gtk_check_button_new ()); @@ -193,8 +192,8 @@ void window_header_bar (GtkWindow *window, char *title){ 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)); + 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)); 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_open_STATE)); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_RULES));