WIP: et faisons fonctionner ces boutons
This commit is contained in:
parent
dcbc47e7a4
commit
49d78fdfd2
10
callback.c
10
callback.c
|
@ -6,7 +6,7 @@
|
||||||
#include "contain.h"
|
#include "contain.h"
|
||||||
#include "dialog.h"
|
#include "dialog.h"
|
||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
#include "in_depth.h"
|
#include "automaton.h"
|
||||||
#include "parsing.h"
|
#include "parsing.h"
|
||||||
#include "graph_area.h"
|
#include "graph_area.h"
|
||||||
|
|
||||||
|
@ -197,9 +197,13 @@ 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) {
|
||||||
printf("SAVE_CURRENT_MODEL_BEFORE_EDITING (callback.c - line 200)\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) {
|
||||||
printf("DISCARD_CURRENT_MODEL_AND_START_EDITING (callback.c - line 204)\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) {
|
||||||
|
printf("callback.c (line 208) - WRITE_THE_CURRENT_MODEL\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <gtk-4.0/gtk/gtk.h>
|
#include <gtk-4.0/gtk/gtk.h>
|
||||||
|
|
||||||
#include "callback.h"
|
#include "callback.h"
|
||||||
#include "in_depth.h"
|
#include "automaton.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
|
|
14
dialog.c
14
dialog.c
|
@ -2,12 +2,13 @@
|
||||||
#include <gtk-4.0/gtk/gtk.h>
|
#include <gtk-4.0/gtk/gtk.h>
|
||||||
|
|
||||||
#include "callback.h"
|
#include "callback.h"
|
||||||
#include "in_depth.h"
|
#include "automaton.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
|
|
||||||
// https://docs.gtk.org/gtk4/visual_index.html < widgets gallery
|
// https://docs.gtk.org/gtk4/visual_index.html < widgets gallery
|
||||||
|
// GTK_ORIENTATION_HORIZONTAL GTK_ORIENTATION_VERTICAL
|
||||||
|
|
||||||
/* doc : see > on_dialog_window_activation (...) in callback.c */
|
/* doc : see > on_dialog_window_activation (...) in callback.c */
|
||||||
|
|
||||||
|
@ -26,11 +27,18 @@ void dialog_window_design (GtkWindow *main_window, GtkWindow *dialog_window){
|
||||||
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), NULL);
|
||||||
gtk_box_append (YES_NO_box, GTK_WIDGET (click_yes));
|
gtk_box_append (YES_NO_box, GTK_WIDGET (click_yes));
|
||||||
|
|
||||||
// gtk_box_append (YES_NO_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
|
|
||||||
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), NULL);
|
||||||
gtk_box_append (YES_NO_box, GTK_WIDGET (click_no));
|
gtk_box_append (YES_NO_box, GTK_WIDGET (click_no));
|
||||||
gtk_window_set_child (dialog_window, GTK_WIDGET (YES_NO_box));
|
|
||||||
|
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));
|
||||||
|
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 (action_save_current_model));
|
||||||
|
gtk_window_set_child (dialog_window, GTK_WIDGET (WINDOW_CHILD_box));
|
||||||
|
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue