using : gtk_widget_set_sensitive (GTK_WIDGET (data), FALSE);

This commit is contained in:
Jean Sirmai 2024-06-11 22:49:42 +02:00
parent 49d78fdfd2
commit c8516d7c43
Signed by: jean
GPG Key ID: FB3115C340E057E3
3 changed files with 18 additions and 12 deletions

View File

@ -197,13 +197,18 @@ void on_toggle_observ_interpret (GtkWidget *btt_toggle_observ_interpret, gpointe
} }
void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data) { void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data) {
gtk_widget_set_sensitive (GTK_WIDGET (data), TRUE);
printf ("callback.c (line 200) - SAVE_CURRENT_MODEL_BEFORE_EDITING\n"); printf ("callback.c (line 200) - SAVE_CURRENT_MODEL_BEFORE_EDITING\n");
} }
void on_DISCARD_CURRENT_MODEL_AND_START_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data) { void on_DISCARD_CURRENT_MODEL_AND_START_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data) {
gtk_widget_set_sensitive (GTK_WIDGET (data), FALSE);
printf ("callback.c (line 204) - DISCARD_CURRENT_MODEL_AND_START_EDITING\n"); printf ("callback.c (line 204) - DISCARD_CURRENT_MODEL_AND_START_EDITING\n");
} }
void on_WRITE_THE_CURRENT_MODEL (GtkWidget *btt_WRITE_CURRENT_MODEL, gpointer data) { void on_WRITE_CURRENT_MODEL (GtkWidget *btt_WRITE_CURRENT_MODEL, gpointer data) {
// close_request (GTK_WINDOW (data)); < comment fermer la fenêtre ? TODO
// attention: déclaration implicite de la fonction « close_request »
printf ("callback.c (line 208) - WRITE_THE_CURRENT_MODEL\n"); printf ("callback.c (line 208) - WRITE_THE_CURRENT_MODEL\n");
} }

View File

@ -20,7 +20,7 @@ void on_toggle_state_rules (GtkWidget *btt_toggle_state_rules, gpointer data);
void on_toggle_observ_interpret (GtkWidget *btt_toggle_observ_interpret, gpointer data); void on_toggle_observ_interpret (GtkWidget *btt_toggle_observ_interpret, gpointer data);
void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, 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_DISCARD_CURRENT_MODEL_AND_START_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data);
void on_WRITE_THE_CURRENT_MODEL (GtkWidget *btt_WRITE_CURRENT_MODEL, gpointer data); void on_WRITE_CURRENT_MODEL (GtkWidget *btt_WRITE_CURRENT_MODEL, gpointer data);

View File

@ -23,17 +23,18 @@ void dialog_window_design (GtkWindow *main_window, GtkWindow *dialog_window){
// gtk_box_layout_set_homogeneous (GTK_BOX (YES_NO_box), TRUE); // gtk_box_layout_set_homogeneous (GTK_BOX (YES_NO_box), TRUE);
// gtk_box_set_baseline_position (YES_NO_box, GTK_BASELINE_POSITION_CENTER); // gtk_box_set_baseline_position (YES_NO_box, GTK_BASELINE_POSITION_CENTER);
GtkButton *action_save_current_model = GTK_BUTTON (gtk_button_new_with_label ("SAVE THE CURRENT MODEL"));
gtk_widget_set_sensitive (GTK_WIDGET (action_save_current_model), FALSE);
g_signal_connect (action_save_current_model, "clicked", G_CALLBACK (on_WRITE_CURRENT_MODEL), dialog_window);
GtkButton *click_yes = GTK_BUTTON (gtk_button_new_with_label ("YES")); GtkButton *click_yes = GTK_BUTTON (gtk_button_new_with_label ("YES"));
g_signal_connect (click_yes, "clicked", G_CALLBACK (on_SAVE_CURRENT_MODEL_BEFORE_EDITING), NULL); g_signal_connect (click_yes, "clicked", G_CALLBACK (on_SAVE_CURRENT_MODEL_BEFORE_EDITING), action_save_current_model);
gtk_box_append (YES_NO_box, GTK_WIDGET (click_yes)); gtk_box_append (YES_NO_box, GTK_WIDGET (click_yes));
GtkButton *click_no = GTK_BUTTON (gtk_button_new_with_label ("NO")); GtkButton *click_no = GTK_BUTTON (gtk_button_new_with_label ("NO"));
g_signal_connect (click_no, "clicked", G_CALLBACK (on_DISCARD_CURRENT_MODEL_AND_START_EDITING), NULL); g_signal_connect (click_no, "clicked", G_CALLBACK (on_DISCARD_CURRENT_MODEL_AND_START_EDITING), action_save_current_model);
gtk_box_append (YES_NO_box, GTK_WIDGET (click_no)); gtk_box_append (YES_NO_box, GTK_WIDGET (click_no));
GtkButton *action_save_current_model = GTK_BUTTON (gtk_button_new_with_label ("SAVE THE CURRENT MODEL"));
g_signal_connect (click_no, "clicked", G_CALLBACK (on_WRITE_THE_CURRENT_MODEL), NULL);
GtkBox *WINDOW_CHILD_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)); GtkBox *WINDOW_CHILD_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
gtk_box_append (WINDOW_CHILD_box, GTK_WIDGET (YES_NO_box)); gtk_box_append (WINDOW_CHILD_box, GTK_WIDGET (YES_NO_box));
gtk_box_append (WINDOW_CHILD_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL))); gtk_box_append (WINDOW_CHILD_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
@ -43,7 +44,7 @@ void dialog_window_design (GtkWindow *main_window, GtkWindow *dialog_window){
gtk_window_set_transient_for (GTK_WINDOW (dialog_window), GTK_WINDOW (main_window)); gtk_window_set_transient_for (GTK_WINDOW (dialog_window), GTK_WINDOW (main_window));
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog_window), TRUE); gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog_window), TRUE);
// gtk_window_set_deletable (GTK_WINDOW (dialog_window), FALSE); // FALSE // gtk_window_set_deletable (GTK_WINDOW (dialog_window), FALSE); // FALSE
// gtk_window_set_modal (GTK_WINDOW (dialog_window), TRUE); gtk_window_set_modal (GTK_WINDOW (dialog_window), TRUE);
gtk_window_present (GTK_WINDOW (dialog_window)); gtk_window_present (GTK_WINDOW (dialog_window));
} }