WIP: un peu 'tricky'... je ne lâche pas le fil...

This commit is contained in:
Jean Sirmai 2024-06-22 06:03:23 +02:00
parent 9a334090c9
commit 48e8884ab1
Signed by: jean
GPG Key ID: FB3115C340E057E3
3 changed files with 17 additions and 8 deletions

View File

@ -190,8 +190,8 @@ void on_toggle_EXEC_EDIT (GtkWidget *btt_XOR_EXEC_EDIT, GtkWidget *btt_MODEL_RUN
void on_open_STATE (GtkWidget *btt_open_STATE, gpointer data) {
printf("on_open_STATE status = %d\n", get_status ());
void on_open_STATE (GtkWidget *btt_open_STATE, gpointer user_data) {
if (0) printf("on_open_STATE status = %d\n", get_status ());
printf("gtk_check_button_get_active > after = %d, %d, %d from callback : on_open_STATE()\n",\
gtk_check_button_get_active (GTK_CHECK_BUTTON (get_GtkButton ("state"))), // (GTK_CHECK_BUTTON (btt_open_STATE)),
gtk_check_button_get_active (GTK_CHECK_BUTTON (get_GtkButton ("rules"))), // (GTK_CHECK_BUTTON (btt_open_RULES)),
@ -201,12 +201,12 @@ void on_open_STATE (GtkWidget *btt_open_STATE, gpointer data) {
}// SWITCH_TO (STATE);}
void on_open_RULES (GtkWidget *btt_open_RULES, gpointer data) {
printf("on_open_RULES status = %d\n", get_status ());
if (0) printf("on_open_RULES status = %d\n", get_status ());
window_main_child (main_window, RULES);
}// SWITCH_TO (RULES);}
void on_open_DATA (GtkWidget *btt_open_DATA, gpointer data) {
printf("on_open_DATA status = %d\n", get_status ());
if (0) printf("on_open_DATA status = %d\n", get_status ());
window_main_child (main_window, DATA);
}// SWITCH_TO (DATA);}
@ -214,9 +214,16 @@ void on_open_DATA (GtkWidget *btt_open_DATA, gpointer data) {
void on_toggle_STATE_RULES_DATA (GtkToggleButton *source, gpointer user_data) {
void on_toggle_STATE_RULES_DATA (char *source, gpointer user_data) {
// https://docs.gtk.org/gtk4/class.ToggleButton.html < f..k ! bad code ++
// g_print ("Toggle button [%s] is active: %s\n", gtk_button_get_label (GTK_BUTTON (source)), gtk_toggle_button_get_active (source) ? "Yes" : "No");
printf("gtk_check_button_get_active > after = %d, %d, %d from callback : on_toggle_STATE_RULES_DATA()\n",\
gtk_check_button_get_active (GTK_CHECK_BUTTON (get_GtkButton (source))),
gtk_check_button_get_active (GTK_CHECK_BUTTON (get_GtkButton (source))),
gtk_check_button_get_active (GTK_CHECK_BUTTON (get_GtkButton (source))));
int choice = 0;
switch (choice) {
case (STATE): get_GtkButton ("state"); break; // get_window_child_STATE ();

View File

@ -24,4 +24,4 @@ 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);
void on_WRITE_CURRENT_MODEL (GtkWidget *btt_WRITE_CURRENT_MODEL, gpointer data);
void on_toggle_STATE_RULES_DATA (GtkToggleButton *source, gpointer user_data);
void on_toggle_STATE_RULES_DATA (char *source, gpointer user_data);

View File

@ -214,18 +214,20 @@ void window_header_bar (GtkWindow *window, char *title){
gtk_check_button_get_label (GTK_CHECK_BUTTON (btt_open_RULES)),
gtk_check_button_get_label (GTK_CHECK_BUTTON (btt_open_DATA)));
printf("gtk_check_button_get_active > before = %d, %d, %d\n",\
if (1) printf("gtk_check_button_get_active > before = %d, %d, %d\n",\
gtk_check_button_get_active (GTK_CHECK_BUTTON (btt_open_STATE)),
gtk_check_button_get_active (GTK_CHECK_BUTTON (btt_open_RULES)),
gtk_check_button_get_active (GTK_CHECK_BUTTON (btt_open_DATA)));
// gtk_check_button_set_active (GTK_CHECK_BUTTON (get_GtkButton ("state")), TRUE);
printf("gtk_check_button_get_active > after = %d, %d, %d\n",\
if (0) printf("gtk_check_button_get_active > after = %d, %d, %d\n",\
gtk_check_button_get_active (GTK_CHECK_BUTTON (get_GtkButton ("state"))), // (GTK_CHECK_BUTTON (btt_open_STATE)),
gtk_check_button_get_active (GTK_CHECK_BUTTON (get_GtkButton ("rules"))), // (GTK_CHECK_BUTTON (btt_open_RULES)),
gtk_check_button_get_active (GTK_CHECK_BUTTON (get_GtkButton ("data analysis")))); // (GTK_CHECK_BUTTON (btt_open_DATA)));
on_toggle_STATE_RULES_DATA ("state", NULL) ;
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)); // << pas ici ! TODO
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (any_Label));