diff --git a/contain.c b/contain.c index 06a1384..93dfac9 100644 --- a/contain.c +++ b/contain.c @@ -79,7 +79,7 @@ GtkWidget *get_run_rules_page_new(){ @see hot.c 2024-05-11 } (line 166) GtkWidget *get_edit_space_page_new(){ GtkWidget *space_grid = gtk_grid_new(); - gtk_grid_attach (GTK_GRID(space_grid), get_SPACE_IMAGE(), 0, 0, 1, 3); + gtk_grid_attach (GTK_GRID(space_grid), get_image_ALL_SPACE(), 0, 0, 1, 3); gtk_grid_attach (GTK_GRID(space_grid), get_OBJECTS_and_SITUATIONS(), 0, 4, 1, 1); gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_XYZ_box()), 1, 0, 1, 2); gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_ZOOM_box()), 1, 2, 1, 2); @@ -102,7 +102,7 @@ GtkWidget *get_run_space_top_box(){ GtkWidget *get_run_space_left_box(){ GtkBox *left_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); - gtk_box_append (left_box, GTK_WIDGET (get_SPACE_IMAGE())); + gtk_box_append (left_box, GTK_WIDGET (get_image_ALL_SPACE())); gtk_box_append (left_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS())); return GTK_WIDGET (left_box); } diff --git a/contain.h b/contain.h index c645467..cd4d05c 100644 --- a/contain.h +++ b/contain.h @@ -9,9 +9,12 @@ #define W 1920 #define H 960 -#define W_IMAGE 1920 - 320 -#define H_IMAGE 960 - 126 +#define W_IMAGE W - 320 +#define H_IMAGE H - 126 #define H_STYLES_PANE 30 +#define W_IMAGE_LOCAL W / 3 +#define H_IMAGE_LOCAL H / 3 + void activate (GtkApplication *app, gpointer user_data); diff --git a/contain.o b/contain.o index 988df15..3530791 100644 Binary files a/contain.o and b/contain.o differ diff --git a/display.c b/display.c index 98a235a..57f484b 100644 --- a/display.c +++ b/display.c @@ -8,7 +8,7 @@ //------------------------------------------------------------------------------ -GtkWidget *get_SPACE_IMAGE(){ +GtkWidget *get_image_ALL_SPACE(){ GtkWidget *image; // forget > GTK_WIDGET(get_scrolled_gl_area()); // Use GtkImage if you want to display a fixed-size icon @@ -20,6 +20,18 @@ GtkWidget *get_SPACE_IMAGE(){ return image; } +GtkWidget *get_image_GLUTAMATE(){ + GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image glutamate.png"); + gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL); + return image; +} + +GtkWidget *get_image_GLUTAMINE(){ + GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image glutamine.png"); + gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL); + return image; +} + //------------------------------------------------------------------------------ // TODO cliquer sur "RUN" --> affiche "STOP" (et inversement) diff --git a/display.h b/display.h index 7fad898..2dbe0f2 100644 --- a/display.h +++ b/display.h @@ -10,7 +10,8 @@ GtkWidget *get_text_view(); GtkFrame *get_frame_with_label(); -GtkWidget *get_SPACE_IMAGE(); +GtkWidget *get_image_ALL_SPACE(); +GtkWidget *get_image_GLUTAMATE(); GtkProgressBar *get_ELAPSED_TIME_ProgressBar(); GtkBox *get_RUN_STOP_box(); GtkBox *get_ZOOM_box(); diff --git a/display.o b/display.o index f66e822..401372e 100644 Binary files a/display.o and b/display.o differ diff --git a/hot.c b/hot.c index d2aab1f..fa2688f 100644 --- a/hot.c +++ b/hot.c @@ -16,41 +16,57 @@ GtkWidget *get_selected_rules_vpaned_new(){ - GtkPaned *vpaned = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL)); + 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)"); - gtk_paned_set_start_child (vpaned, GTK_WIDGET (règle_sélectionnée_n_1)); - gtk_paned_set_end_child (vpaned, GTK_WIDGET (règle_sélectionnée_n_2)); -// gtk_paned_set_wide_handle (vpaned, TRUE); - return GTK_WIDGET (vpaned); + GtkBox *up_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); + gtk_box_append (up_box, GTK_WIDGET (get_image_GLUTAMATE())); + GtkBox *down_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); + gtk_box_append (down_box, GTK_WIDGET (get_image_GLUTAMINE())); + + 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 (down_box)); +// gtk_paned_set_wide_handle (V_selected_1_vs_2, TRUE); + +/* GtkWidget *picture_before = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image glutamine"); + GtkWidget *picture_after = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image glutamate"); + gtk_widget_set_size_request (GTK_WIDGET (picture_before), W_IMAGE_LOCAL, H_IMAGE_LOCAL); + gtk_widget_set_size_request (GTK_WIDGET (picture_after), W_IMAGE_LOCAL, H_IMAGE_LOCAL);*/ + +// gtk_window_set_child (GTK_WINDOW (règle_sélectionnée_n_1), GTK_WIDGET(up_box)); +// gtk_window_set_child (GTK_WINDOW (up_box), GTK_WIDGET(picture_before)); + + return GTK_WIDGET (V_selected_1_vs_2); } GtkWidget *get_rules_tree_hpaned_new(){ - GtkPaned *hpaned = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL)); + 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 (hpaned, GTK_WIDGET (arbre_des_règles)); - gtk_paned_set_end_child (hpaned, GTK_WIDGET (comparaison_des_règles_sélectionnées)); - gtk_paned_set_position (hpaned, 300); - gtk_paned_set_wide_handle (hpaned, TRUE); - return GTK_WIDGET (hpaned); + gtk_paned_set_start_child (H_tree_vs_comparison, GTK_WIDGET (arbre_des_règles)); + gtk_paned_set_end_child (H_tree_vs_comparison, GTK_WIDGET (comparaison_des_règles_sélectionnées)); + 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 *hpaned = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL)); + 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 (hpaned, GTK_WIDGET (get_rules_tree_hpaned_new())); - gtk_paned_set_end_child (hpaned, GTK_WIDGET (get_selected_rules_vpaned_new())); - gtk_paned_set_position (hpaned, 600); - gtk_paned_set_wide_handle (hpaned, TRUE); - // gtk_widget_set_size_request (GTK_WIDGET (hpaned), W, H); // inutile... ? - return GTK_WIDGET (hpaned); + 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); } diff --git a/hot.h b/hot.h index a863a40..348d3c3 100644 --- a/hot.h +++ b/hot.h @@ -13,3 +13,4 @@ #include "contain.h" GtkWidget *get_run_rules_page_new(); +GtkWidget *get_image_GLUTAMATE(); diff --git a/hot.o b/hot.o index dcf1d8b..7335e13 100644 Binary files a/hot.o and b/hot.o differ diff --git a/image glutamate.png b/image glutamate.png new file mode 100644 index 0000000..dc474be Binary files /dev/null and b/image glutamate.png differ diff --git a/image glutamine.png b/image glutamine.png new file mode 100644 index 0000000..7ac3bb7 Binary files /dev/null and b/image glutamine.png differ diff --git a/main.o b/main.o index 3e74b0f..23a8556 100644 Binary files a/main.o and b/main.o differ diff --git a/myprogram b/myprogram index 1c04479..25d8fa1 100755 Binary files a/myprogram and b/myprogram differ