diff --git a/include/signal.h b/include/signal.h index 103c4eb..5ad03e7 100644 --- a/include/signal.h +++ b/include/signal.h @@ -128,7 +128,7 @@ void on_resetting_XYZ_in_state_page (); void on_clicked_topbar_right_home (GtkWidget *btt_reset, gpointer data); void on_clicked_topbar_right_search (GtkWidget *btt_menu, gpointer list_box); -void on_clicked_topbar_right_measure (GtkWidget *btt_measure, gpointer data); +void on_topbar_right_measure_clicked (GtkWidget *btt_measure, gpointer data); diff --git a/src/signal.c b/src/signal.c index 356aa27..24d13d9 100644 --- a/src/signal.c +++ b/src/signal.c @@ -423,18 +423,22 @@ void on_situations_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrol /* M E A S U R E S */ /******************************************************************************/ -void on_clicked_topbar_right_measure (GtkWidget *btt, gpointer data) +void on_topbar_right_measure_clicked (GtkWidget *btt, gpointer button_icon_name) { - fsm_journal_event (DEBUG, BUTTON, "signal", "clicked topbar right measure()", "🧭️"); -// fsm_measures_sorted_list_do something (); +// ici, il faudrait surtout dire que: widget_get_measure_page +// devient un enfant de: widget_get_main_window. + fsm_journal_event (DEBUG, BUTTON, "signal", "topbar right measure()", + concat ("clicked; icon = ", button_icon_name, NULL)); +// fsm_measures_sorted_list_do something (); TODO +// ! WARNING ! ce qui suit n'est qu'une maquette: (... delenda est !) +// la 'logique' qui va des mesures aux résultats doit changer de forme TODO gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), GTK_WIDGET (widget_get_measure_page())); } -void on_start_new_measure (GtkWidget *btt, gpointer data) +void on_start_new_measure (GtkWidget *btt, gpointer btt_label) { - fsm_journal_event (DEBUG, BUTTON, "signal", "start a new measure()", - gtk_button_get_label (GTK_BUTTON (btt))); // gtk_label_get_text () ? TODO + fsm_journal_event (DEBUG, BUTTON, "signal", "start a new measure()", btt_label); gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), GTK_WIDGET (widget_measure_do_select_rules_first())); } diff --git a/src/widget/measure/dispatch.c b/src/widget/measure/dispatch.c index a19b105..ad4aa10 100644 --- a/src/widget/measure/dispatch.c +++ b/src/widget/measure/dispatch.c @@ -24,6 +24,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#include "../../../include/util.h" #include "../../../include/base.h" #include "../../../include/signal.h" #include "../../../include/widget.h" @@ -295,21 +296,17 @@ void *widget_get_measure_page() { measure_page = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); edit_a_new_measure_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); - caliper = gtk_picture_new_for_filename - ("./data/stamp/measure caliper icon.png"); - btt_edit_a_new_measure = gtk_toggle_button_new_with_label ("edit a new measure"); - - printf("gtk_button_get_label (btt_edit_a_new_measure) = %s <---\ - \npourquoi est-ce que je n'arrive pas à afficher ce label dans le journal ? \n", - gtk_button_get_label (GTK_BUTTON (btt_edit_a_new_measure))); - // voir signal > void on_start_new_measure (GtkWidget *btt, gpointer data)) - + caliper = gtk_picture_new_for_filename ("./data/stamp/measure caliper icon.png"); // TODO icon + char *btt_lab = "edit a new measure"; + btt_edit_a_new_measure = gtk_toggle_button_new_with_label (btt_lab); g_signal_connect (btt_edit_a_new_measure, "toggled", - G_CALLBACK (on_start_new_measure), NULL); - + G_CALLBACK (on_start_new_measure), + concat ("label = ", btt_lab, " (+/- caliper icon)", NULL)); gtk_box_append (edit_a_new_measure_box, GTK_WIDGET (caliper)); gtk_box_append (edit_a_new_measure_box, GTK_WIDGET (btt_edit_a_new_measure)); gtk_box_append (measure_page, GTK_WIDGET (edit_a_new_measure_box)); + fsm_journal_event (DEBUG, BUTTON, "widget/measure/dispatch", "widget_get_measure_page()", + concat ("creates: ", btt_lab, " in: measure_page", NULL)); return measure_page; } diff --git a/src/widget/topbar/right.c b/src/widget/topbar/right.c index ebfdcb9..3cff98c 100644 --- a/src/widget/topbar/right.c +++ b/src/widget/topbar/right.c @@ -62,7 +62,8 @@ static void display_widgets_at_the_right_side (GtkWidget *header_bar) GtkButton *measure = GTK_BUTTON (gtk_button_new ()); gtk_button_set_icon_name (measure, "color-select-symbolic"); - g_signal_connect (measure, "clicked", G_CALLBACK (on_clicked_topbar_right_measure), no_local_data); + g_signal_connect (measure, "clicked", G_CALLBACK (on_topbar_right_measure_clicked), + "color-select-symbolic"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), GTK_WIDGET (measure)); list_box = gtk_list_box_new();