Compare commits
9 Commits
Author | SHA1 | Date |
---|---|---|
Jean Sirmai | e797211e1e | |
Jean Sirmai | 1d99bf35ce | |
Jean Sirmai | 6f463326f9 | |
Jean Sirmai | e6871816a4 | |
Jean Sirmai | bd252031c7 | |
Jean Sirmai | 0f0c21b299 | |
Jean Sirmai | 981886d79b | |
Jean Sirmai | 4cd7a0215a | |
Jean Sirmai | 83c3254732 |
37
automaton.c
37
automaton.c
|
@ -8,16 +8,23 @@
|
|||
/* S T A T E S */
|
||||
/******************************************************************************/
|
||||
|
||||
/* (exec / edit)
|
||||
* X
|
||||
* (state / rules / data)
|
||||
* X
|
||||
* (measure / analyse / interpret)
|
||||
* X
|
||||
* (read / write)
|
||||
/* (exec / edit) < MODE
|
||||
* X
|
||||
* (state / rules / data) < STATUS
|
||||
* X
|
||||
* (measure / analyse / interpret)
|
||||
* X
|
||||
* (read / write)
|
||||
*/
|
||||
|
||||
static int mode = RUN;
|
||||
void set_mode (int prescribed) {mode = prescribed;}
|
||||
int get_mode () {return mode;}
|
||||
|
||||
static int status = INTER; // int get_status () {return status;}
|
||||
void set_status (int prescribed) {status = prescribed;}
|
||||
int get_status () {return status;}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* T R A N S I T I O N S */
|
||||
|
@ -25,17 +32,17 @@ static int status = INTER; // int get_status () {return status;}
|
|||
|
||||
void SWITCH_TO (int asked) {
|
||||
switch (asked) {
|
||||
case (INTER) : // BEGIN_TO_EXEC_STOP
|
||||
status = STATE; printf ("SWITCH_TO INTER\n");
|
||||
case (INTER) :
|
||||
status = INTER; printf ("SWITCH_TO INTER\n");
|
||||
break;
|
||||
case (STATE) : // EXEC_STOP_TO_RUN
|
||||
status = RULES; printf ("SWITCH_TO STATE\n");
|
||||
case (STATE) : // BEGIN_TO_EXEC_STOP
|
||||
status = STATE; printf ("SWITCH_TO STATE\n");
|
||||
break;
|
||||
case (RULES) : // EXEC_RUN_TO_STOP
|
||||
status = DATA; printf ("SWITCH_TO RULES\n");
|
||||
case (RULES) : // EXEC_STOP_TO_RUN
|
||||
status = RULES; printf ("SWITCH_TO RULES\n");
|
||||
break;
|
||||
case (DATA) : // EXEC_TO_INTER
|
||||
status = INTER; printf ("SWITCH_TO DATA\n");
|
||||
case (DATA) : // EXEC_RUN_TO_STOP
|
||||
status = DATA; printf ("SWITCH_TO DATA\n");
|
||||
break;
|
||||
default : ;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,11 @@
|
|||
|
||||
void set_status (int prescribed);
|
||||
int get_status ();
|
||||
void set_mode (int prescribed);
|
||||
int get_mode ();
|
||||
|
||||
enum mode { RUN, EDIT };
|
||||
enum choice { INTER, STATE, RULES, DATA };
|
||||
// MEASURE, OBSERVE, INTERPRET, HELP, CONFIGURE };
|
||||
|
||||
void SWITCH_TO (int asked);
|
||||
|
|
69
callback.c
69
callback.c
|
@ -166,32 +166,57 @@ void on_axis_value_change(GtkAdjustment *adjustment, gpointer data)
|
|||
/******************************************************************************/
|
||||
/* B U T T O N S */
|
||||
/******************************************************************************/
|
||||
void on_toggle_model_exec (GtkWidget *btt_run_stop_model_exec, gpointer data) {}
|
||||
void on_toggle_observ_interpret (GtkWidget *btt_toggle_observ_interpret, gpointer data) {}
|
||||
void on_toggle_exec_edit (GtkWidget *btt_exec_xor_edit, GtkWidget *btt_run_stop_model_exec) {
|
||||
// gtk_button_set_icon_name (GTK_BUTTON (btt_exec_xor_edit), "power-profile-balanced-rtl-symbolic");
|
||||
// gtk_button_set_label (GTK_BUTTON (btt_run_stop_model_exec), " run ");
|
||||
// gtk_widget_set_sensitive (GTK_WIDGET (btt_run_stop_model_exec), TRUE);
|
||||
void on_toggle_MODEL_RUN_STOP (GtkWidget *btt_MODEL_RUN_STOP, gpointer data) {
|
||||
if (strcmp (gtk_button_get_label (GTK_BUTTON (btt_MODEL_RUN_STOP)), " run "))
|
||||
gtk_button_set_label (GTK_BUTTON (btt_MODEL_RUN_STOP), " run ");
|
||||
else gtk_button_set_label (GTK_BUTTON (btt_MODEL_RUN_STOP), " stop ");
|
||||
}
|
||||
|
||||
void on_toggle_EXEC_EDIT (GtkWidget *btt_XOR_EXEC_EDIT, GtkWidget *btt_MODEL_RUN_STOP) {
|
||||
if (get_mode()) {
|
||||
gtk_button_set_icon_name (GTK_BUTTON (btt_XOR_EXEC_EDIT), "power-profile-balanced-rtl-symbolic");
|
||||
gtk_button_set_label (GTK_BUTTON (btt_MODEL_RUN_STOP), " run ");
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (btt_MODEL_RUN_STOP), TRUE);
|
||||
set_mode (0);
|
||||
} else {
|
||||
gtk_button_set_icon_name (GTK_BUTTON (btt_XOR_EXEC_EDIT), "preferences-system-symbolic");
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (btt_MODEL_RUN_STOP), FALSE);
|
||||
set_mode (1);
|
||||
}
|
||||
}
|
||||
|
||||
void on_toggle_STATE_RULES_DATA (GtkWidget *btt_toggle_STATE_RULES_DATA, gpointer data)
|
||||
{
|
||||
const char* current_label = gtk_button_get_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA));
|
||||
if (0) printf ("callback.c (line 191) - current_label = %s\n", current_label);
|
||||
void on_toggle_STATE_RULES_DATA (GtkToggleButton *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("Callback on_toggle_STATE_RULES_DATA %d %s\n", get_status(), gtk_button_get_label (GTK_BUTTON (source)));
|
||||
int choice = 0;
|
||||
switch (choice) {
|
||||
case (INTER): get_window_child_STATE (); break;
|
||||
case (STATE): get_window_child_STATE (); break;
|
||||
case (RULES): get_window_child_STATE (); break;
|
||||
case (DATA): get_window_child_STATE (); break;
|
||||
default : get_window_child_STATE ();
|
||||
}
|
||||
}
|
||||
|
||||
if (! strcmp (current_label, "analyse")) {
|
||||
gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), " state ");
|
||||
window_main_child (main_window, 0);
|
||||
}
|
||||
else if (! strcmp (current_label, " state ")) {
|
||||
gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), " rules ");
|
||||
window_main_child (main_window, 1);
|
||||
}
|
||||
else {
|
||||
gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA), "analyse");
|
||||
window_main_child (main_window, 2);
|
||||
}
|
||||
/*
|
||||
GtkToggleButton *source
|
||||
g_print ("Toggle button "%s" is active: %s",
|
||||
gtk_button_get_label (GTK_BUTTON (source)),
|
||||
gtk_toggle_button_get_active (source) ? "Yes" : "No");*/
|
||||
void on_open_STATE (GtkWidget *btt_open_STATE, gpointer data) {
|
||||
get_window_child_STATE (main_window);
|
||||
SWITCH_TO (STATE);
|
||||
}
|
||||
|
||||
void on_open_RULES (GtkWidget *btt_open_RULES, gpointer data) {
|
||||
get_window_child_RULES (main_window);
|
||||
SWITCH_TO (RULES);
|
||||
}
|
||||
|
||||
void on_open_DATA (GtkWidget *btt_open_DATA, gpointer data) {
|
||||
get_window_child_DATA (main_window);
|
||||
SWITCH_TO (DATA);
|
||||
}
|
||||
|
||||
void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data) {
|
||||
|
|
12
callback.h
12
callback.h
|
@ -14,12 +14,14 @@ void on_glarea_unrealize (GtkWidget *widget);
|
|||
|
||||
void on_axis_value_change (GtkAdjustment *adjustment, gpointer data);
|
||||
|
||||
void on_toggle_exec_edit (GtkWidget *btt_exec_xor_edit, GtkWidget *btt_run_stop_model_exec);
|
||||
void on_toggle_model_exec (GtkWidget *btt_run_stop_model_exec, gpointer data);
|
||||
void on_toggle_STATE_RULES_DATA (GtkWidget *btt_toggle_STATE_RULES_DATA, gpointer data);
|
||||
void on_toggle_observ_interpret (GtkWidget *btt_toggle_observ_interpret, gpointer data);
|
||||
void on_toggle_EXEC_EDIT (GtkWidget *btt_XOR_EXEC_EDIT, GtkWidget *btt_MODEL_RUN_STOP);
|
||||
void on_toggle_MODEL_RUN_STOP (GtkWidget *btt_MODEL_RUN_STOP, gpointer data);
|
||||
|
||||
void on_open_STATE (GtkWidget *btt_open_STATE, gpointer data);
|
||||
void on_open_RULES (GtkWidget *btt_open_RULES, gpointer data);
|
||||
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);
|
||||
|
|
190
contain.c
190
contain.c
|
@ -154,7 +154,7 @@ void window_main_child_bottom (GtkBox *page_box){
|
|||
|
||||
static void icons_for_fun (GtkHeaderBar *header_bar);
|
||||
|
||||
void window_header_bar (GtkWindow *window, char *title){
|
||||
void window_header_bar (GtkWindow *window, char *title) { // https://docs.gtk.org/gtk4/class.ToggleButton.html
|
||||
GtkWidget *header_bar = GTK_WIDGET (gtk_header_bar_new ());
|
||||
gtk_header_bar_set_title_widget (GTK_HEADER_BAR (header_bar), gtk_label_new (title));
|
||||
gtk_window_set_titlebar (window, header_bar);
|
||||
|
@ -164,61 +164,183 @@ void window_header_bar (GtkWindow *window, char *title){
|
|||
|
||||
gpointer no_local_data = NULL;
|
||||
|
||||
GtkButton *exec_xor_edit = GTK_BUTTON (gtk_toggle_button_new ());
|
||||
gtk_button_set_icon_name (exec_xor_edit, "system-run-symbolic");
|
||||
gtk_button_set_icon_name (exec_xor_edit, "power-profile-balanced-rtl-symbolic");
|
||||
// g_signal_connect (exec_xor_edit, "clicked", G_CALLBACK (on_toggle_exec_edit), run_stop_model_exec);
|
||||
GtkButton *btt_MODEL_RUN_STOP = GTK_BUTTON (gtk_button_new_with_label (" run "));
|
||||
g_signal_connect (btt_MODEL_RUN_STOP, "clicked", G_CALLBACK (on_toggle_MODEL_RUN_STOP), no_local_data);
|
||||
|
||||
GtkButton *btt_XOR_EXEC_EDIT = GTK_BUTTON (gtk_toggle_button_new ());
|
||||
gtk_button_set_icon_name (btt_XOR_EXEC_EDIT, "system-run-symbolic");
|
||||
gtk_button_set_icon_name (btt_XOR_EXEC_EDIT, "power-profile-balanced-rtl-symbolic");
|
||||
g_signal_connect (btt_XOR_EXEC_EDIT, "clicked", G_CALLBACK (on_toggle_EXEC_EDIT), btt_MODEL_RUN_STOP);
|
||||
|
||||
// GtkWidget* separe = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
|
||||
// gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (separe));
|
||||
GtkWidget *any_Label = GTK_WIDGET (gtk_label_new (" | "));
|
||||
|
||||
GtkWidget *any_Label = GTK_WIDGET (gtk_label_new ("------------"));
|
||||
GtkCheckButton *group_STATE_RULES_DATA = GTK_CHECK_BUTTON (gtk_check_button_new ());
|
||||
|
||||
GtkButton *run_stop_model_exec = GTK_BUTTON (gtk_button_new_with_label (" run "));
|
||||
g_signal_connect (run_stop_model_exec, "clicked", G_CALLBACK (on_toggle_model_exec), no_local_data);
|
||||
GtkButton *btt_open_STATE = GTK_BUTTON (gtk_check_button_new_with_label ("state"));
|
||||
printf("GtkButton label > %s\n", gtk_button_get_label (GTK_BUTTON (btt_open_STATE)));
|
||||
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_STATE), group_STATE_RULES_DATA);
|
||||
g_signal_connect (btt_open_STATE, "toggled", G_CALLBACK (on_toggle_STATE_RULES_DATA), NULL);
|
||||
|
||||
GtkButton *btt_toggle_STATE_RULES_DATA = GTK_BUTTON (gtk_button_new_with_label (" state "));
|
||||
g_signal_connect (btt_toggle_STATE_RULES_DATA, "clicked", G_CALLBACK (on_toggle_STATE_RULES_DATA), no_local_data);
|
||||
GtkButton *btt_open_RULES = GTK_BUTTON (gtk_check_button_new_with_label ("rules"));
|
||||
printf("GtkButton label > %s\n", gtk_button_get_label (GTK_BUTTON (btt_open_RULES)));
|
||||
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_RULES), group_STATE_RULES_DATA);
|
||||
g_signal_connect (btt_open_RULES, "toggled", G_CALLBACK (on_toggle_STATE_RULES_DATA), NULL);
|
||||
|
||||
// GtkButton *observ_interpret = GTK_BUTTON (gtk_button_new_with_label ("data analysis"));
|
||||
// g_signal_connect (observ_interpret, "clicked", G_CALLBACK (on_toggle_observ_interpret), no_local_data);
|
||||
GtkButton *btt_open_DATA = GTK_BUTTON (gtk_check_button_new_with_label ("data analysis"));
|
||||
printf("GtkButton label > %s\n", gtk_button_get_label (GTK_BUTTON (btt_open_DATA)));
|
||||
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_DATA), group_STATE_RULES_DATA);
|
||||
g_signal_connect (btt_open_DATA, "toggled", G_CALLBACK (on_toggle_STATE_RULES_DATA), NULL);
|
||||
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (exec_xor_edit));
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (run_stop_model_exec));
|
||||
gtk_check_button_set_active (GTK_CHECK_BUTTON (btt_open_STATE), TRUE);
|
||||
|
||||
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));
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (any_Label));
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_toggle_STATE_RULES_DATA));
|
||||
// gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (observ_interpret));
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_STATE));
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_RULES));
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_DATA));
|
||||
|
||||
icons_for_fun (GTK_HEADER_BAR (header_bar)); // https://iconduck.com/sets/adwaita-icon-theme
|
||||
// icons_for_fun (GTK_HEADER_BAR (header_bar)); // https://iconduck.com/sets/adwaita-icon-theme
|
||||
}
|
||||
|
||||
void window_main_child (GtkWindow *main_window, int selected_page){
|
||||
// in_depth.c : enum { STATE, RULES, MEASURE, OBSERVE, INTERPRET, HELP, CONFIGURE };
|
||||
switch (selected_page) {
|
||||
case (0) : // STATE
|
||||
GtkWidget *get_window_child_STATE () {
|
||||
GtkBox *page_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
|
||||
gtk_box_append (page_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS()));
|
||||
gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
gtk_box_append (page_box, GTK_WIDGET (get_SPACE_VIEW_box()));
|
||||
gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
window_main_child_bottom (page_box);
|
||||
// if (get_status ()) gtk_box_append (page_box, GTK_WIDGET (get_TIME_EXEC_controls_box()));
|
||||
// else gtk_box_append (page_box, GTK_WIDGET (get_SPACE_EDIT_controls_box()));
|
||||
gtk_window_set_child (main_window, GTK_WIDGET (page_box));
|
||||
break;
|
||||
case (1) : gtk_window_set_child (main_window, GTK_WIDGET (get_rules_page_new())); break;
|
||||
case (2) : gtk_window_set_child (main_window, GTK_WIDGET (get_measures_page_new())); break;
|
||||
case (3) : gtk_window_set_child (main_window, GTK_WIDGET (get_results_page_new())); break;
|
||||
case (4) : gtk_window_set_child (main_window, GTK_WIDGET (get_discuss_page_new())); break;
|
||||
case (5) : gtk_window_set_child (main_window, GTK_WIDGET (get_help_page_new())); break;
|
||||
default : gtk_window_set_child (main_window, GTK_WIDGET (get_SPACE_VIEW_box())); // + un "help message"
|
||||
}
|
||||
if (!get_mode ()) gtk_box_append (page_box, GTK_WIDGET (get_TIME_EXEC_controls_box()));
|
||||
else gtk_box_append (page_box, GTK_WIDGET (get_SPACE_EDIT_controls_box()));
|
||||
//SWITCH_TO (STATE);
|
||||
return GTK_WIDGET (page_box);
|
||||
}
|
||||
|
||||
GtkWidget *get_window_child_RULES (){
|
||||
GtkPaned *H_tree_vs_selected = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
|
||||
|
||||
// GtkWidget *arbre_des_règles = gtk_frame_new ("Arbre des règles");
|
||||
// GtkWidget *édition_de_la_règle_sélectionnée_n_1 = gtk_frame_new ("Inspection");
|
||||
|
||||
gtk_paned_set_start_child (H_tree_vs_selected, GTK_WIDGET (get_rules_tree_hpaned_new()));
|
||||
gtk_paned_set_end_child (H_tree_vs_selected, GTK_WIDGET (get_selected_rules_vpaned_new()));
|
||||
gtk_paned_set_position (H_tree_vs_selected, 500); // WARNING : c'est une position "absolue"
|
||||
gtk_paned_set_wide_handle (H_tree_vs_selected, TRUE);
|
||||
// gtk_widget_set_size_request (GTK_WIDGET (H_tree_vs_selected), W, H); // inutile... ?
|
||||
return GTK_WIDGET (H_tree_vs_selected);
|
||||
}
|
||||
|
||||
GtkWidget *get_window_child_DATA (){
|
||||
GtkBox *data_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 32));
|
||||
|
||||
GtkWidget* frame_rule_effect = gtk_frame_new ("rule effect\n-----------");
|
||||
gtk_frame_set_label_align (GTK_FRAME (frame_rule_effect), 0.5);
|
||||
GtkBox *rule_effect_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8));
|
||||
gtk_frame_set_child (GTK_FRAME (frame_rule_effect), GTK_WIDGET (rule_effect_box));
|
||||
|
||||
GtkWidget* frame_rule_topic = gtk_frame_new ("rule topic\n----------");
|
||||
gtk_frame_set_label_align (GTK_FRAME (frame_rule_topic), 0.5);
|
||||
GtkBox *rule_topic_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8));
|
||||
gtk_frame_set_child (GTK_FRAME (frame_rule_topic), GTK_WIDGET (rule_topic_box));
|
||||
|
||||
GtkWidget* frame_data_type = gtk_frame_new ("data type\n----------");
|
||||
gtk_frame_set_label_align (GTK_FRAME (frame_data_type), 0.5);
|
||||
GtkBox *data_type_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8));
|
||||
gtk_frame_set_child (GTK_FRAME (frame_data_type), GTK_WIDGET (data_type_box));
|
||||
|
||||
GtkWidget* frame_interpretations = gtk_frame_new ("interpretation\n---------------");
|
||||
gtk_frame_set_label_align (GTK_FRAME (frame_interpretations), 0.5);
|
||||
GtkBox *interpretations_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8));
|
||||
gtk_frame_set_child (GTK_FRAME (frame_interpretations), GTK_WIDGET (interpretations_box));
|
||||
|
||||
GtkWidget* frame_discussions = gtk_frame_new ("discussion\n------------");
|
||||
gtk_frame_set_label_align (GTK_FRAME (frame_discussions), 0.5);
|
||||
GtkBox *discussions_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8));
|
||||
gtk_frame_set_child (GTK_FRAME (frame_discussions), GTK_WIDGET (discussions_box));
|
||||
|
||||
GtkWidget* frame_game = gtk_frame_new ("game\n------");
|
||||
gtk_frame_set_label_align (GTK_FRAME (frame_game), 0.5);
|
||||
GtkBox *game_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8));
|
||||
gtk_frame_set_child (GTK_FRAME (frame_game), GTK_WIDGET (game_box));
|
||||
|
||||
GtkWidget* frame_help = gtk_frame_new ("help\n-----");
|
||||
gtk_frame_set_label_align (GTK_FRAME (frame_help), 0.5);
|
||||
GtkBox *help_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8));
|
||||
gtk_frame_set_child (GTK_FRAME (frame_help), GTK_WIDGET (help_box));
|
||||
|
||||
//gtk_box_append (xxx_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
|
||||
gtk_box_append (data_box, GTK_WIDGET (frame_rule_effect));
|
||||
gtk_box_append (data_box, GTK_WIDGET (frame_rule_topic));
|
||||
gtk_box_append (data_box, GTK_WIDGET (frame_data_type));
|
||||
gtk_box_append (data_box, GTK_WIDGET (frame_interpretations));
|
||||
gtk_box_append (data_box, GTK_WIDGET (frame_discussions));
|
||||
gtk_box_append (data_box, GTK_WIDGET (frame_game));
|
||||
gtk_box_append (data_box, GTK_WIDGET (frame_help));
|
||||
|
||||
// gtk_box_append (rule_effect_box, gtk_label_new ("*"));
|
||||
gtk_box_append (rule_effect_box, gtk_button_new_with_label ("movement"));
|
||||
gtk_box_append (rule_effect_box, gtk_button_new_with_label ("transport"));
|
||||
gtk_box_append (rule_effect_box, gtk_button_new_with_label ("transformation"));
|
||||
|
||||
// gtk_box_append (rule_topic_box, gtk_label_new ("*"));
|
||||
gtk_box_append (rule_topic_box, gtk_button_new_with_label ("objects"));
|
||||
gtk_box_append (rule_topic_box, gtk_button_new_with_label ("situations"));
|
||||
|
||||
gtk_box_append (rule_topic_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
gtk_box_append (rule_topic_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
gtk_box_append (rule_topic_box, gtk_button_new_with_label ("accuracy"));
|
||||
gtk_box_append (rule_topic_box, gtk_button_new_with_label ("pattern recognition"));
|
||||
|
||||
// gtk_box_append (data_type_box, gtk_label_new ("*"));
|
||||
gtk_box_append (data_type_box, gtk_button_new_with_label ("repartitions"));
|
||||
gtk_box_append (data_type_box, gtk_button_new_with_label ("evolutions"));
|
||||
gtk_box_append (data_type_box, gtk_button_new_with_label ("correlations"));
|
||||
|
||||
// gtk_box_append (interpretations_box, gtk_label_new ("*"));
|
||||
gtk_box_append (interpretations_box, gtk_button_new_with_label ("stochastic"));
|
||||
gtk_box_append (interpretations_box, gtk_button_new_with_label ("deterministic"));
|
||||
|
||||
gtk_box_append (interpretations_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
gtk_box_append (interpretations_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
gtk_box_append (interpretations_box, gtk_button_new_with_label ("physical"));
|
||||
gtk_box_append (interpretations_box, gtk_button_new_with_label ("chemical"));
|
||||
gtk_box_append (interpretations_box, gtk_button_new_with_label ("biological"));
|
||||
gtk_box_append (interpretations_box, gtk_button_new_with_label ("social"));
|
||||
gtk_box_append (interpretations_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
|
||||
// gtk_box_append (discussions_box, gtk_label_new ("*"));
|
||||
gtk_box_append (discussions_box, gtk_button_new_with_label ("context"));
|
||||
gtk_box_append (discussions_box, gtk_button_new_with_label ("methodology"));
|
||||
gtk_box_append (discussions_box, gtk_button_new_with_label ("comparisons"));
|
||||
gtk_box_append (discussions_box, gtk_button_new_with_label ("to improve"));
|
||||
gtk_box_append (discussions_box, gtk_button_new_with_label ("summary"));
|
||||
|
||||
// gtk_box_append (game_box, gtk_label_new ("*"));
|
||||
gtk_box_append (game_box, gtk_button_new_with_label ("single player"));
|
||||
gtk_box_append (game_box, gtk_button_new_with_label ("multiple players"));
|
||||
gtk_box_append (game_box, gtk_button_new_with_label ("edition facilities"));
|
||||
|
||||
// gtk_box_append (help_box, gtk_label_new ("*"));
|
||||
gtk_box_append (help_box, gtk_button_new_with_label ("modelization"));
|
||||
gtk_box_append (help_box, gtk_button_new_with_label ("measurements"));
|
||||
gtk_box_append (help_box, gtk_button_new_with_label ("results"));
|
||||
gtk_box_append (help_box, gtk_button_new_with_label ("data analysis"));
|
||||
|
||||
gtk_box_append (help_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
gtk_box_append (help_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
gtk_box_append (help_box, gtk_button_new_with_label ("preferences"));
|
||||
|
||||
return GTK_WIDGET (data_box);
|
||||
}
|
||||
|
||||
void main_window_design (GtkWindow *main_window){
|
||||
window_main_child (main_window, 0); // 0 is the state page
|
||||
window_header_bar (main_window,
|
||||
"E coli (with permission from David S. Goodsell, 2009)");
|
||||
gtk_window_set_child (main_window, get_window_child_STATE ());
|
||||
gtk_window_set_child (main_window, get_window_child_RULES ());
|
||||
gtk_window_set_child (main_window, get_window_child_DATA ());
|
||||
gtk_window_present (GTK_WINDOW (main_window));
|
||||
}
|
||||
|
||||
|
|
|
@ -35,5 +35,7 @@ void two_notebooks_in_two_panes (GtkWindow *window);
|
|||
GtkWidget *get_selected_rules_vpaned_new();
|
||||
GtkFrame *get_frame_with_label();
|
||||
void window_main_child_bottom (GtkBox *page_box);
|
||||
void window_main_child (GtkWindow *main_window, int selected_page);
|
||||
|
||||
//void window_main_child (GtkWindow *main_window, int selected_page);
|
||||
GtkWidget *get_window_child_STATE ();
|
||||
GtkWidget *get_window_child_RULES ();
|
||||
GtkWidget *get_window_child_DATA ();
|
||||
|
|
Loading…
Reference in New Issue