diff --git a/cold.c b/cold.c index a1c71f4..e934a94 100644 --- a/cold.c +++ b/cold.c @@ -102,8 +102,8 @@ GtkProgressBar *get_simulation_time_extent_buffer(){ GtkScrolledWindow *get_scrolled_gl_area(){ GtkScrolledWindow *scrolled = GTK_SCROLLED_WINDOW(gtk_scrolled_window_new()); - gtk_scrolled_window_set_min_content_width (scrolled, W_GL_AREA); - gtk_scrolled_window_set_min_content_height (scrolled, H_GL_AREA); + gtk_scrolled_window_set_min_content_width (scrolled, W_IMAGE); + gtk_scrolled_window_set_min_content_height (scrolled, H_IMAGE); // GtkAdjustment *width = gtk_adjustment_new (600, 300, 1000, 1, 1, 1000); // GtkAdjustment *height = gtk_adjustment_new (600, 300, 1000, 1, 1, 1000); // (value, lower, upper, step_increment, page_increment, page_size) @@ -166,8 +166,8 @@ GtkWidget *get_rules_page_new(){ gtk_paned_set_start_child (GTK_PANED(hpaned), GTK_WIDGET (frame1)); gtk_paned_set_end_child (GTK_PANED(hpaned), GTK_WIDGET (frame2)); - gtk_widget_set_size_request (hpaned, 100, H); - gtk_widget_set_size_request (frame1, 100, H); // < utile seulement pour la largeur min/max + gtk_widget_set_size_request (hpaned, W, H); +// gtk_widget_set_size_request (frame1, 0, H); // < utile seulement pour la largeur min/max // gtk_widget_set_size_request (frame2, 50, 100); // gtk_grid_attach (GTK_GRID (rules_grid), hpaned, 0, 0, 1, 1); @@ -182,13 +182,16 @@ GtkWidget *get_space_page_new(){ // attach either : get_ELAPSED_TIME_box() or get_simulation_time_extent_buffer() // gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_ELAPSED_TIME_box()), 0, 0, 1, 1); gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_simulation_time_extent_buffer()), 0, 0, 1, 1); - gtk_grid_attach (GTK_GRID(space_grid), get_a_space_test_image(), 0, 1, 1, 4); - gtk_grid_attach (GTK_GRID(space_grid), get_objects_and_situations_horizontal_pane(), 0, 5, 1, 1); + gtk_grid_attach (GTK_GRID(space_grid), get_a_space_test_image(), 0, 1, 1, 3); + gtk_grid_attach (GTK_GRID(space_grid), get_objects_and_situations_horizontal_pane(), 0, 4, 1, 1); gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_RUN_STOP_box()), 1, 0, 1, 1); - gtk_grid_attach (GTK_GRID(space_grid), get_scroll_speed(), 1, 2, 1, 1); - gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_STEP_by_STEP_box()), 1, 3, 1, 1); - gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_XYZ_box()), 1, 4, 1, 1); - gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_ZOOM_box()), 1, 5, 1, 1); + gtk_grid_attach (GTK_GRID(space_grid), get_scroll_speed(), 1, 1, 1, 1); + gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_STEP_by_STEP_box()), 1, 2, 1, 1); + gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_XYZ_box()), 1, 3, 1, 1); + gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_ZOOM_box()), 1, 4, 1, 1); +// How to use gtk_separators ? +// gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)), 1, 1, 1, 1); + return space_grid; } diff --git a/cold.h b/cold.h index a82495f..55bbad3 100644 --- a/cold.h +++ b/cold.h @@ -11,8 +11,8 @@ #include #define W 1920 #define H 960 -#define W_GL_AREA 1920 - 64 -#define H_GL_AREA 960 - 46 +#define W_IMAGE 1920 - 64 +#define H_IMAGE 960 - 46 #define H_STYLES_PANE 60 void print_text(GtkWidget *widget, gpointer data); diff --git a/cold.o b/cold.o index a686977..fcfd782 100644 Binary files a/cold.o and b/cold.o differ diff --git a/hot.c b/hot.c index 030a33b..ed51f93 100644 --- a/hot.c +++ b/hot.c @@ -4,24 +4,53 @@ #include "cold.h" // https://docs.gtk.org/gtk4/visual_index.html < widgets gallery +// GTK_ORIENTATION_VERTICAL GTK_ORIENTATION_HORIZONTAL + +GtkWidget *get_scroll_interest_0(){ + GtkAdjustment *interest_adjust = gtk_adjustment_new (0, 0, 100, 1, 0, 0); + GtkWidget *scroll_interest_0 = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, interest_adjust); + return scroll_interest_0; +} + +GtkBox *get_objects_box(){ + GtkBox *objects_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); + gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" membrane "))); + gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" enzyme A "))); + gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" ribosome "))); + gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" chromosome "))); + return objects_box; +} + +GtkBox *get_situations_box(){ + GtkBox *situations_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); + gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" transcription "))); + gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" épissage "))); + gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" translation "))); + gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" ubiquitination "))); + return situations_box; +} static GtkWidget *get_frame_objects(){ - GtkWidget *frame_objects = gtk_frame_new ("Objects"); // define each class of object transparence - gtk_widget_set_size_request (frame_objects, 100, H_STYLES_PANE); // < utile seulement pour la largeur min/max + GtkWidget *frame_objects = gtk_frame_new ("Objects"); // defines each class of object transparence + gtk_widget_set_size_request (frame_objects, 0, H_STYLES_PANE); // < utile seulement pour la largeur min/max +// compute_child_allocation (frame_objects, GdkRectangle); +// gtk_frame_set_child (frame_objects, get_scroll_interest_0()); + gtk_frame_set_child (GTK_FRAME (frame_objects), GTK_WIDGET (get_objects_box())); return frame_objects; } static GtkWidget *get_frame_situations(){ - GtkWidget *frame_situations = gtk_frame_new ("Situations"); // facilitate each situation identification - gtk_widget_set_size_request (frame_situations, 100, H_STYLES_PANE); // < utile seulement pour la largeur min/max + GtkWidget *frame_situations = gtk_frame_new ("Situations"); // facilitates each situation identification + gtk_widget_set_size_request (GTK_WIDGET (frame_situations), 0, H_STYLES_PANE); // < utile seulement pour la largeur min/max + gtk_frame_set_child (GTK_FRAME (frame_situations), GTK_WIDGET (get_situations_box())); return frame_situations; } GtkWidget *get_objects_and_situations_horizontal_pane(){ GtkWidget *objects_and_situations_horizontal_pane = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); GtkWidget *frame_situations = gtk_frame_new ("Situations"); // facilitate each situation identification - gtk_widget_set_size_request (objects_and_situations_horizontal_pane, W_GL_AREA, H_STYLES_PANE); - gtk_widget_set_size_request (frame_situations, 100, H_STYLES_PANE); // < utile seulement pour la largeur min/max + gtk_widget_set_size_request (objects_and_situations_horizontal_pane, W_IMAGE, H_STYLES_PANE); + gtk_widget_set_size_request (GTK_WIDGET (frame_situations), 100, H_STYLES_PANE); // < utile seulement pour la largeur min/max gtk_paned_set_start_child (GTK_PANED(objects_and_situations_horizontal_pane), GTK_WIDGET (get_frame_objects())); gtk_paned_set_end_child (GTK_PANED(objects_and_situations_horizontal_pane), GTK_WIDGET (get_frame_situations())); return objects_and_situations_horizontal_pane; diff --git a/hot.o b/hot.o index ba91c16..c768311 100644 Binary files a/hot.o and b/hot.o differ diff --git a/myprogram b/myprogram index 9dcb5ad..88c712c 100755 Binary files a/myprogram and b/myprogram differ