GTK4_GG_hack/hot.c

107 lines
5.3 KiB
C

#include <stdio.h>
#include <gtk-4.0/gtk/gtk.h>
#include "warm.h"
#include "cold.h"
#include "display.h"
#include "contain.h"
#include "texts.h"
// https://forge.a-lec.org/gem-graph/gem-graph-client/src/branch/devel/Makefile
// https://docs.gtk.org/gtk4/visual_index.html < widgets gallery
// https://docs.gtk.org/gtk4/section-text-widget.html
// https://docs.gtk.org/gtk4/class.Widget.html#height-for-width-geometry-management
// GTK_ORIENTATION_VERTICAL GTK_ORIENTATION_HORIZONTAL
GtkWidget *get_selected_rules_vpaned_new(){
GtkPaned *V_selected_1_vs_2 = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL));
// GtkWidget *règle_sélectionnée_n_1 = gtk_frame_new ("(1)");
// GtkWidget *règle_sélectionnée_n_2 = gtk_frame_new ("(2)");
GtkBox *up_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
gtk_box_append (up_box, GTK_WIDGET (get_image_GLUTAMATE()));
gtk_box_append (up_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
gtk_box_append (up_box, GTK_WIDGET (get_image_GLUTAMINE()));
/*
GtkBox *bottom_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
gtk_box_append (bottom_box, GTK_WIDGET (get_image_PHENYLALANINE()));
gtk_box_append (bottom_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
gtk_box_append (bottom_box, GTK_WIDGET (get_image_DOPAMINE()));
*/
GtkBox *bottom_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
gtk_box_append (bottom_box, GTK_WIDGET (get_image_ATP()));
gtk_box_append (bottom_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
gtk_box_append (bottom_box, GTK_WIDGET (get_image_AMP()));
gtk_paned_set_start_child (V_selected_1_vs_2, GTK_WIDGET (up_box));
gtk_paned_set_end_child (V_selected_1_vs_2, GTK_WIDGET (bottom_box));
// gtk_paned_set_start_child (V_selected_1_vs_2, GTK_WIDGET (règle_sélectionnée_n_1));
// gtk_paned_set_end_child (V_selected_1_vs_2, GTK_WIDGET (règle_sélectionnée_n_2));
// gtk_box_append ( GTK_BOX(règle_sélectionnée_n_1), GTK_WIDGET (up_box));//, GTK_WIDGET (get_image_GLUTAMATE()));
// gtk_box_append ( GTK_BOX(règle_sélectionnée_n_2), GTK_WIDGET (bottom_box));//, GTK_WIDGET (get_image_GLUTAMATE()));
return GTK_WIDGET (V_selected_1_vs_2);
}
GtkBox *get_rules_user_tree_new(){
GtkBox *tree_sketch = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
gtk_box_append (tree_sketch, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (tree_sketch, GTK_WIDGET (get_user_tree()));
gtk_box_append (tree_sketch, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
return tree_sketch;
}
GtkBox *get_rules_comparator_new(){
GtkBox *comparator = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
gtk_box_append (comparator, GTK_WIDGET (get_image_ATP()));
gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (comparator, GTK_WIDGET (get_image_AMP()));
gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (comparator, GTK_WIDGET (get_image_GLUTAMATE()));
gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (comparator, GTK_WIDGET (get_image_GLUTAMINE()));
gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (comparator, GTK_WIDGET (get_image_HISTIDINE()));
gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (comparator, GTK_WIDGET (get_image_PHENYLALANINE()));
gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (comparator, GTK_WIDGET (get_image_DOPAMINE()));
gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
return comparator;
}
GtkWidget *get_rules_tree_hpaned_new(){
GtkPaned *H_tree_vs_comparison = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
GtkWidget *arbre_des_règles = gtk_frame_new ("Arbre");
GtkWidget *comparaison_des_règles_sélectionnées = gtk_frame_new ("Sélection");
gtk_paned_set_start_child (H_tree_vs_comparison, GTK_WIDGET (get_rules_user_tree_new()));
gtk_paned_set_end_child (H_tree_vs_comparison, GTK_WIDGET (get_rules_comparator_new()));
gtk_paned_set_position (H_tree_vs_comparison, 300);
gtk_paned_set_wide_handle (H_tree_vs_comparison, TRUE);
gtk_paned_set_shrink_start_child (H_tree_vs_comparison, FALSE);
gtk_paned_set_shrink_end_child (H_tree_vs_comparison, FALSE);
return GTK_WIDGET (H_tree_vs_comparison);
}
GtkWidget *get_run_rules_page_new(){
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, 600); // 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);
}