diff --git a/2024-04-30.png b/2024-04-30.png deleted file mode 100644 index ff01e7c..0000000 Binary files a/2024-04-30.png and /dev/null differ diff --git a/2024-05-01.png b/2024-05-01.png deleted file mode 100644 index 5c73332..0000000 Binary files a/2024-05-01.png and /dev/null differ diff --git a/E coli by David S. Goodsell (2009).png b/E coli by David S. Goodsell (2009).png new file mode 100644 index 0000000..55b14b8 Binary files /dev/null and b/E coli by David S. Goodsell (2009).png differ diff --git a/cold.c b/cold.c index c94470d..3d8a0b1 100644 --- a/cold.c +++ b/cold.c @@ -16,6 +16,41 @@ GtkWidget *get_objects_and_situations_horizontal_pane(){ return objects_and_situations_horizontal_pane; } +GtkWidget *get_a_space_test_image(){ + GtkWidget *image; + image = GTK_WIDGET(get_scrolled_gl_area()); + image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/images/aXoris.png"); + image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/images/gg sketch.png"); + image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/images/E coli.png"); + image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/images/E coli resized.png"); + image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/E coli by David S. Goodsell (2009).png"); + return image; +} + +GtkWidget *get_scroll_speed(){ + GtkAdjustment *speed_adjust = gtk_adjustment_new (0, 0, 100, 1, 0, 0); + GtkWidget *scroll_speed = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, speed_adjust); + return scroll_speed; +} + +GtkBox *get_XYZ_gtk_box(){ + GtkBox *XYZ_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); // spacing = 2 + // GtkWidget *scale_X = gtk_scale_button_new (0, 360, 10, NULL); < à étudier + // (double min, double max, double step, const char** icons) + GtkAdjustment *X_adjust = gtk_adjustment_new (0, 0, 380, 1, 0, 0); + GtkAdjustment *Y_adjust = gtk_adjustment_new (0, 0, 380, 1, 0, 0); + GtkAdjustment *Z_adjust = gtk_adjustment_new (0, 0, 380, 1, 0, 0); + GtkWidget *scroll_X = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, X_adjust); + GtkWidget *scroll_Y = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, Y_adjust); + GtkWidget *scroll_Z = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, Z_adjust); + + gtk_box_append (XYZ_box, scroll_X); + gtk_box_append (XYZ_box, scroll_Y); + gtk_box_append (XYZ_box, scroll_Z); + + return XYZ_box; +} + GtkProgressBar *get_simulation_time_extent_buffer(){ GtkProgressBar *buffer = GTK_PROGRESS_BAR (gtk_progress_bar_new ()); gtk_progress_bar_set_text (buffer, "<--- [buffer] (simulation extent time) --->"); @@ -23,19 +58,28 @@ GtkProgressBar *get_simulation_time_extent_buffer(){ return 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); // 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) - GtkWidget *GLarea = gtk_gl_area_new(); - gtk_scrolled_window_set_child (scrolled, GLarea); + // (value, lower, upper, step_increment, page_increment, page_size) +// GtkWidget *GLarea = gtk_gl_area_new(); +// gtk_scrolled_window_set_child (scrolled, GLarea); // https://docs.gtk.org/gtk4/class.GLArea.html return scrolled; } + + + + +/*---------------------------------------------------------------------------*/ + + + GtkWidget *get_measures_page_new(){ GtkWidget *measures_grid = gtk_grid_new(); gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("movements"), 0, 0, 1, 1); @@ -94,6 +138,8 @@ void window_bar(GtkWindow *window, char *title){ GtkWidget *titlebar = gtk_header_bar_new(); gtk_window_set_title (window, title); gtk_window_set_titlebar (window, titlebar); // header_bar +// GtkWidget my_window_controls = *gtk_window_controls_new (GTK_PACK_END); // _START +// gtk_window_controls_set_decoration_layout (GTK_WINDOW_CONTROLS(my_window_controls), NULL); // const char* layout); } void activate (GtkApplication *app, gpointer user_data) { diff --git a/cold.h b/cold.h index 1d3c02c..3866aec 100644 --- a/cold.h +++ b/cold.h @@ -7,7 +7,10 @@ #define H_STYLES_PANE 60 void print_text(GtkWidget *widget, gpointer data); +GtkWidget *get_a_space_test_image(); GtkScrolledWindow *get_scrolled_gl_area(); +GtkBox *get_XYZ_gtk_box(); +GtkWidget *get_scroll_speed(); void window_bar(GtkWindow *window, char *title); GtkWidget *get_objects_and_situations_horizontal_pane(); GtkProgressBar *get_simulation_time_extent_buffer(); diff --git a/cold.o b/cold.o index a19c604..0c7a30d 100644 Binary files a/cold.o and b/cold.o differ diff --git a/hot.c b/hot.c index 973a20d..c51ff52 100644 --- a/hot.c +++ b/hot.c @@ -8,6 +8,20 @@ // https://docs.gtk.org/gtk4/visual_index.html < widgets gallery GtkWidget *get_space_page_new(){ + + GtkWidget *space_grid = gtk_grid_new(); + + gtk_grid_attach (GTK_GRID (space_grid), get_objects_and_situations_horizontal_pane(), 0, 0, 1, 1); + gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_a_space_test_image()), 0, 1, 1, 10); + gtk_grid_attach (GTK_GRID(space_grid), gtk_button_new_with_label ("RUN"), 1, 0, 1, 1); + gtk_grid_attach (GTK_GRID(space_grid), get_scroll_speed(), 1, 1, 1, 1); + gtk_grid_attach (GTK_GRID(space_grid), gtk_button_new_with_label ("Step"), 1, 2, 1, 1); +// gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_simulation_time_extent_buffer()), 0, 2, 1, 1); + gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_XYZ_gtk_box()), 1, 3, 1, 1); + gtk_grid_attach (GTK_GRID(space_grid), gtk_button_new_with_label ("zoom"), 1, 4, 1, 1); + + return space_grid; +} /* GtkBox *controls_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)); gtk_box_append (controls_box, gtk_button_new_with_label ("RUN")); @@ -23,8 +37,6 @@ GtkWidget *get_space_page_new(){ gtk_progress_bar_set_text (buffer, "<--- [buffer] (simulation extent time) --->"); gtk_progress_bar_set_show_text (buffer, TRUE); // gtk_box_append (controls_box, GTK_WIDGET(buffer));//gtk_button_new_with_label ("---- buffer ----")); -*/ - GtkBox *XYZ_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); // spacing = 2 @@ -40,7 +52,7 @@ GtkWidget *get_space_page_new(){ gtk_box_append (XYZ_box, scroll_X); gtk_box_append (XYZ_box, scroll_Y); gtk_box_append (XYZ_box, scroll_Z); -/* + GtkWidget *bottom_grid = gtk_grid_new(); // gtk_grid_attach (GTK_GRID(bottom_grid), GTK_WIDGET(controls_box), 0, 0, 1, 1); gtk_grid_attach (GTK_GRID(bottom_grid), gtk_button_new_with_label ("Objects / Situations (transparences, styles)"), 0, 1, 1, 1); @@ -55,19 +67,5 @@ GtkWidget *get_space_page_new(){ gtk_paned_set_start_child (GTK_PANED(objects_and_situations_horizontal_pane), GTK_WIDGET (frame_objects)); gtk_paned_set_end_child (GTK_PANED(objects_and_situations_horizontal_pane), GTK_WIDGET (frame_situations)); */ - GtkWidget *space_grid = gtk_grid_new(); - gtk_grid_attach (GTK_GRID (space_grid), get_objects_and_situations_horizontal_pane(), 0, 0, 1, 1); - gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_scrolled_gl_area()), 0, 1, 1, 10); - gtk_grid_attach (GTK_GRID(space_grid), gtk_button_new_with_label ("RUN"), 1, 0, 1, 1); - GtkAdjustment *speed_adjust = gtk_adjustment_new (0, 0, 100, 1, 0, 0); - GtkWidget *scroll_speed = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, speed_adjust); - gtk_grid_attach (GTK_GRID(space_grid), scroll_speed, 1, 1, 1, 1); - gtk_grid_attach (GTK_GRID(space_grid), gtk_button_new_with_label ("Step"), 1, 2, 1, 1); - gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_simulation_time_extent_buffer()), 0, 2, 1, 1); - gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(XYZ_box), 1, 3, 1, 1); - gtk_grid_attach (GTK_GRID(space_grid), gtk_button_new_with_label ("zoom"), 1, 4, 1, 1); - return space_grid; - -} diff --git a/hot.o b/hot.o index 88bea5a..c9dfed1 100644 Binary files a/hot.o and b/hot.o differ diff --git a/main.o b/main.o index b364a66..e7ebb20 100644 Binary files a/main.o and b/main.o differ diff --git a/myprogram b/myprogram index dc6dc4d..06288f3 100755 Binary files a/myprogram and b/myprogram differ diff --git a/warm.c b/warm.c index 13e9083..c700774 100644 --- a/warm.c +++ b/warm.c @@ -38,7 +38,7 @@ GtkWidget *get_space_page_new_2024_04_30 (){ gtk_grid_attach (GTK_GRID(bottom_grid), gtk_button_new_with_label ("zoom, +/- grid,\npresentation,\nstyles,..."), 1, 0, 1, 2); GtkWidget *space_grid = gtk_grid_new(); - gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_scrolled_gl_area()), 0, 0, 1, 1); + gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_a_space_test_image()), 0, 0, 1, 1); gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(XYZ_box), 1, 0, 1, 1); gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(bottom_grid), 0, 1, 2, 1); // ?! échec x_size // gtk_grid_attach (GTK_GRID(space_grid), gtk_button_new_with_label ("?"), 1, 1, 1, 1); diff --git a/warm.o b/warm.o index 2584186..360a7fe 100644 Binary files a/warm.o and b/warm.o differ