WIP: gtk_window_close (GTK_WINDOW (data)); < ferme la fenêtre dialogue

This commit is contained in:
Jean Sirmai 2024-06-12 00:16:45 +02:00
parent c8516d7c43
commit d1918a0d0b
Signed by: jean
GPG Key ID: FB3115C340E057E3
2 changed files with 7 additions and 8 deletions

View File

@ -198,17 +198,16 @@ 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); gtk_widget_set_sensitive (GTK_WIDGET (data), TRUE);
printf ("callback.c (line 200) - SAVE_CURRENT_MODEL_BEFORE_EDITING\n"); printf ("callback.c (line 201) - 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); gtk_window_close (GTK_WINDOW (data));
printf ("callback.c (line 204) - DISCARD_CURRENT_MODEL_AND_START_EDITING\n"); printf ("callback.c (line 206) - DISCARD_CURRENT_MODEL_AND_START_EDITING\n");
} }
void on_WRITE_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 gtk_window_close (GTK_WINDOW (data));
// attention: déclaration implicite de la fonction « close_request » printf ("callback.c (line 211) - WRITE_CURRENT_MODEL\n");
printf ("callback.c (line 208) - WRITE_THE_CURRENT_MODEL\n");
} }

View File

@ -32,7 +32,7 @@ void dialog_window_design (GtkWindow *main_window, GtkWindow *dialog_window){
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), action_save_current_model); g_signal_connect (click_no, "clicked", G_CALLBACK (on_DISCARD_CURRENT_MODEL_AND_START_EDITING), dialog_window);
gtk_box_append (YES_NO_box, GTK_WIDGET (click_no)); gtk_box_append (YES_NO_box, GTK_WIDGET (click_no));
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));
@ -43,7 +43,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));
} }