Compare commits

..

1 Commits

7 changed files with 107 additions and 239 deletions

View File

@ -8,23 +8,16 @@
/* S T A T E S */ /* S T A T E S */
/******************************************************************************/ /******************************************************************************/
/* (exec / edit) < MODE /* (exec / edit)
* X * X
* (state / rules / data) < STATUS * (state / rules / data)
* X * X
* (measure / analyse / interpret) * (measure / analyse / interpret)
* X * X
* (read / write) * (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;} 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 */ /* T R A N S I T I O N S */
@ -32,17 +25,17 @@ int get_status () {return status;}
void SWITCH_TO (int asked) { void SWITCH_TO (int asked) {
switch (asked) { switch (asked) {
case (INTER) : case (INTER) : // BEGIN_TO_EXEC_STOP
status = INTER; printf ("SWITCH_TO INTER\n"); status = STATE; printf ("SWITCH_TO INTER\n");
break; break;
case (STATE) : // BEGIN_TO_EXEC_STOP case (STATE) : // EXEC_STOP_TO_RUN
status = STATE; printf ("SWITCH_TO STATE\n"); status = RULES; printf ("SWITCH_TO STATE\n");
break; break;
case (RULES) : // EXEC_STOP_TO_RUN case (RULES) : // EXEC_RUN_TO_STOP
status = RULES; printf ("SWITCH_TO RULES\n"); status = DATA; printf ("SWITCH_TO RULES\n");
break; break;
case (DATA) : // EXEC_RUN_TO_STOP case (DATA) : // EXEC_TO_INTER
status = DATA; printf ("SWITCH_TO DATA\n"); status = INTER; printf ("SWITCH_TO DATA\n");
break; break;
default : ; default : ;
} }

View File

@ -3,11 +3,7 @@
void set_status (int prescribed); void set_status (int prescribed);
int get_status (); int get_status ();
void set_mode (int prescribed);
int get_mode ();
enum mode { RUN, EDIT };
enum choice { INTER, STATE, RULES, DATA }; enum choice { INTER, STATE, RULES, DATA };
// MEASURE, OBSERVE, INTERPRET, HELP, CONFIGURE };
void SWITCH_TO (int asked); void SWITCH_TO (int asked);

View File

@ -166,57 +166,59 @@ void on_axis_value_change(GtkAdjustment *adjustment, gpointer data)
/******************************************************************************/ /******************************************************************************/
/* B U T T O N S */ /* B U T T O N S */
/******************************************************************************/ /******************************************************************************/
void on_toggle_MODEL_RUN_STOP (GtkWidget *btt_MODEL_RUN_STOP, gpointer data) { void on_toggle_model_exec (GtkWidget *btt_run_stop_model_exec, gpointer data) {}
if (strcmp (gtk_button_get_label (GTK_BUTTON (btt_MODEL_RUN_STOP)), " run ")) void on_toggle_observ_interpret (GtkWidget *btt_toggle_observ_interpret, gpointer data) {}
gtk_button_set_label (GTK_BUTTON (btt_MODEL_RUN_STOP), " run "); void on_toggle_exec_edit (GtkWidget *btt_exec_xor_edit, GtkWidget *btt_run_stop_model_exec) {
else gtk_button_set_label (GTK_BUTTON (btt_MODEL_RUN_STOP), " stop "); // 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_EXEC_EDIT (GtkWidget *btt_XOR_EXEC_EDIT, GtkWidget *btt_MODEL_RUN_STOP) {
if (get_mode()) { void on_toggle_STATE_RULES_DATA (GtkButton *btt_toggle_STATE_RULES_DATA,
gtk_button_set_icon_name (GTK_BUTTON (btt_XOR_EXEC_EDIT), "power-profile-balanced-rtl-symbolic"); GtkButton *btt_toggle_STATE_DATA_RULES)
gtk_button_set_label (GTK_BUTTON (btt_MODEL_RUN_STOP), " run "); {
gtk_widget_set_sensitive (GTK_WIDGET (btt_MODEL_RUN_STOP), TRUE); const char* current_label = gtk_button_get_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA));
set_mode (0); if (0) printf ("callback.c (line 182) - current_label = %s\n", current_label);
} else {
gtk_button_set_icon_name (GTK_BUTTON (btt_XOR_EXEC_EDIT), "preferences-system-symbolic"); if (! strcmp (current_label, "analyse")) {
gtk_widget_set_sensitive (GTK_WIDGET (btt_MODEL_RUN_STOP), FALSE); gtk_button_set_label (btt_toggle_STATE_RULES_DATA, " state ");
set_mode (1); gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_DATA_RULES), " state ");
window_main_child (main_window, 0);
}
else if (! strcmp (current_label, " state ")) {
gtk_button_set_label (btt_toggle_STATE_RULES_DATA, " rules ");
gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_DATA_RULES), " rules ");
window_main_child (main_window, 1);
}
else {
gtk_button_set_label (btt_toggle_STATE_RULES_DATA, "analyse");
gtk_button_set_label (GTK_BUTTON (btt_toggle_STATE_DATA_RULES), "analyse");
window_main_child (main_window, 2);
} }
} }
void on_toggle_STATE_RULES_DATA (GtkToggleButton *source, gpointer user_data) { void on_toggle_STATE_DATA_RULES (GtkButton *btt_toggle_STATE_RULES_DATA,
// https://docs.gtk.org/gtk4/class.ToggleButton.html < f..k ! bad code ++ GtkButton *btt_toggle_STATE_DATA_RULES)
// 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))); const char* current_label = gtk_button_get_label (GTK_BUTTON (btt_toggle_STATE_RULES_DATA));
int choice = 0; if (0) printf ("callback.c (line 205) - current_label = %s\n", current_label);
switch (choice) {
case (INTER): get_window_child_STATE (); break; if (! strcmp (current_label, "analyse")) {
case (STATE): get_window_child_STATE (); break; gtk_button_set_label (btt_toggle_STATE_RULES_DATA, " state ");
case (RULES): get_window_child_STATE (); break; gtk_button_set_label (btt_toggle_STATE_DATA_RULES, " state ");
case (DATA): get_window_child_STATE (); break; window_main_child (main_window, 0);
default : get_window_child_STATE (); }
else if (! strcmp (current_label, " rules ")) {
gtk_button_set_label (btt_toggle_STATE_RULES_DATA, "analyse");
gtk_button_set_label (btt_toggle_STATE_DATA_RULES, "analyse");
window_main_child (main_window, 1);
}
else {
gtk_button_set_label (btt_toggle_STATE_RULES_DATA, " rules ");
gtk_button_set_label (btt_toggle_STATE_DATA_RULES, " rules ");
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) { void on_SAVE_CURRENT_MODEL_BEFORE_EDITING (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data) {

View File

@ -14,14 +14,13 @@ void on_glarea_unrealize (GtkWidget *widget);
void on_axis_value_change (GtkAdjustment *adjustment, gpointer data); void on_axis_value_change (GtkAdjustment *adjustment, gpointer data);
void on_toggle_EXEC_EDIT (GtkWidget *btt_XOR_EXEC_EDIT, GtkWidget *btt_MODEL_RUN_STOP); void on_toggle_exec_edit (GtkWidget *btt_exec_xor_edit, GtkWidget *btt_run_stop_model_exec);
void on_toggle_MODEL_RUN_STOP (GtkWidget *btt_MODEL_RUN_STOP, gpointer data); void on_toggle_model_exec (GtkWidget *btt_run_stop_model_exec, gpointer data);
void on_toggle_STATE_RULES_DATA (GtkButton *btt_toggle_STATE_RULES_DATA, GtkButton *btt_toggle_STATE_DATA_RULES);
void on_open_STATE (GtkWidget *btt_open_STATE, gpointer data); void on_toggle_STATE_DATA_RULES (GtkButton *btt_toggle_STATE_DATA_RULES, GtkButton *btt_toggle_STATE_RULES_DATA);
void on_open_RULES (GtkWidget *btt_open_RULES, gpointer data); void on_toggle_observ_interpret (GtkWidget *btt_toggle_observ_interpret, 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_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_CURRENT_MODEL (GtkWidget *btt_WRITE_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);

193
contain.c
View File

@ -154,7 +154,7 @@ void window_main_child_bottom (GtkBox *page_box){
static void icons_for_fun (GtkHeaderBar *header_bar); static void icons_for_fun (GtkHeaderBar *header_bar);
void window_header_bar (GtkWindow *window, char *title) { // https://docs.gtk.org/gtk4/class.ToggleButton.html void window_header_bar (GtkWindow *window, char *title){
GtkWidget *header_bar = GTK_WIDGET (gtk_header_bar_new ()); 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_header_bar_set_title_widget (GTK_HEADER_BAR (header_bar), gtk_label_new (title));
gtk_window_set_titlebar (window, header_bar); gtk_window_set_titlebar (window, header_bar);
@ -164,183 +164,64 @@ void window_header_bar (GtkWindow *window, char *title) { // https://docs.gtk.or
gpointer no_local_data = NULL; gpointer no_local_data = NULL;
GtkButton *btt_MODEL_RUN_STOP = GTK_BUTTON (gtk_button_new_with_label (" run ")); GtkButton *exec_xor_edit = GTK_BUTTON (gtk_toggle_button_new ());
g_signal_connect (btt_MODEL_RUN_STOP, "clicked", G_CALLBACK (on_toggle_MODEL_RUN_STOP), no_local_data); gtk_button_set_icon_name (exec_xor_edit, "system-run-symbolic");
gtk_button_set_icon_name (exec_xor_edit, "power-profile-balanced-rtl-symbolic");
GtkButton *btt_XOR_EXEC_EDIT = GTK_BUTTON (gtk_toggle_button_new ()); // g_signal_connect (exec_xor_edit, "clicked", G_CALLBACK (on_toggle_exec_edit), run_stop_model_exec);
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); // GtkWidget* separe = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
// gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (separe)); // gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (separe));
GtkWidget *any_Label = GTK_WIDGET (gtk_label_new (" | "));
GtkCheckButton *group_STATE_RULES_DATA = GTK_CHECK_BUTTON (gtk_check_button_new ()); GtkWidget *any_Label = GTK_WIDGET (gtk_label_new ("------------"));
GtkButton *btt_open_STATE = GTK_BUTTON (gtk_check_button_new_with_label ("state")); GtkButton *run_stop_model_exec = GTK_BUTTON (gtk_button_new_with_label (" run "));
printf("GtkButton label > %s\n", gtk_button_get_label (GTK_BUTTON (btt_open_STATE))); g_signal_connect (run_stop_model_exec, "clicked", G_CALLBACK (on_toggle_model_exec), no_local_data);
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_open_RULES = GTK_BUTTON (gtk_check_button_new_with_label ("rules")); GtkButton *btt_toggle_STATE_RULES_DATA = GTK_BUTTON (gtk_button_new_with_label (" state "));
printf("GtkButton label > %s\n", gtk_button_get_label (GTK_BUTTON (btt_open_RULES))); GtkButton *btt_toggle_STATE_DATA_RULES = GTK_BUTTON (gtk_button_new_with_label (" state "));
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_RULES), group_STATE_RULES_DATA); g_signal_connect (btt_toggle_STATE_RULES_DATA, "clicked", G_CALLBACK (on_toggle_STATE_RULES_DATA), btt_toggle_STATE_DATA_RULES);
g_signal_connect (btt_open_RULES, "toggled", G_CALLBACK (on_toggle_STATE_RULES_DATA), NULL); g_signal_connect (btt_toggle_STATE_RULES_DATA, "clicked", G_CALLBACK (on_toggle_STATE_DATA_RULES), btt_toggle_STATE_RULES_DATA);
GtkButton *btt_open_DATA = GTK_BUTTON (gtk_check_button_new_with_label ("data analysis")); // GtkButton *observ_interpret = GTK_BUTTON (gtk_button_new_with_label ("data analysis"));
printf("GtkButton label > %s\n", gtk_button_get_label (GTK_BUTTON (btt_open_DATA))); // g_signal_connect (observ_interpret, "clicked", G_CALLBACK (on_toggle_observ_interpret), no_local_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_check_button_set_active (GTK_CHECK_BUTTON (btt_open_STATE), TRUE); 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_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 (any_Label));
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_toggle_STATE_RULES_DATA));
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_toggle_STATE_DATA_RULES));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_DATA)); // gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (observ_interpret));
// 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
} }
GtkWidget *get_window_child_STATE () { 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
GtkBox *page_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); 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 (get_OBJECTS_and_SITUATIONS()));
gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); 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 (get_SPACE_VIEW_box()));
gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
if (!get_mode ()) gtk_box_append (page_box, GTK_WIDGET (get_TIME_EXEC_controls_box())); window_main_child_bottom (page_box);
else gtk_box_append (page_box, GTK_WIDGET (get_SPACE_EDIT_controls_box())); // if (get_status ()) gtk_box_append (page_box, GTK_WIDGET (get_TIME_EXEC_controls_box()));
//SWITCH_TO (STATE); // else gtk_box_append (page_box, GTK_WIDGET (get_SPACE_EDIT_controls_box()));
return GTK_WIDGET (page_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;
GtkWidget *get_window_child_RULES (){ case (2) : gtk_window_set_child (main_window, GTK_WIDGET (get_measures_page_new())); break;
GtkPaned *H_tree_vs_selected = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL)); 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;
// GtkWidget *arbre_des_règles = gtk_frame_new ("Arbre des règles"); case (5) : gtk_window_set_child (main_window, GTK_WIDGET (get_help_page_new())); break;
// GtkWidget *édition_de_la_règle_sélectionnée_n_1 = gtk_frame_new ("Inspection"); default : gtk_window_set_child (main_window, GTK_WIDGET (get_SPACE_VIEW_box())); // + un "help message"
}
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){ void main_window_design (GtkWindow *main_window){
window_main_child (main_window, 0); // 0 is the state page
window_header_bar (main_window, window_header_bar (main_window,
"E coli (with permission from David S. Goodsell, 2009)"); "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)); gtk_window_present (GTK_WINDOW (main_window));
} }

View File

@ -35,7 +35,5 @@ void two_notebooks_in_two_panes (GtkWindow *window);
GtkWidget *get_selected_rules_vpaned_new(); GtkWidget *get_selected_rules_vpaned_new();
GtkFrame *get_frame_with_label(); GtkFrame *get_frame_with_label();
void window_main_child_bottom (GtkBox *page_box); 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 ();

View File

@ -21,7 +21,6 @@ GtkWidget *get_image_PHENYLALANINE();
GtkWidget *get_image_DOPAMINE(); GtkWidget *get_image_DOPAMINE();
GtkWidget *get_image_ATP(); GtkWidget *get_image_ATP();
GtkWidget *get_image_AMP(); GtkWidget *get_image_AMP();
GtkWidget *get_rules_tree_hpaned_new();
GtkProgressBar *get_ELAPSED_TIME_ProgressBar(); GtkProgressBar *get_ELAPSED_TIME_ProgressBar();
GtkBox *get_RUN_STOP_box(); GtkBox *get_RUN_STOP_box();