objects and situations boxes in paned frames + labels

This commit is contained in:
Jean Sirmai 2024-05-06 23:29:54 +02:00
parent e9bd2abb7c
commit 9ae7bc16d3
Signed by: jean
GPG Key ID: FB3115C340E057E3
6 changed files with 50 additions and 18 deletions

23
cold.c
View File

@ -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;
}

4
cold.h
View File

@ -11,8 +11,8 @@
#include <gtk/gtk.h>
#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);

BIN
cold.o

Binary file not shown.

41
hot.c
View File

@ -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;

BIN
hot.o

Binary file not shown.

BIN
myprogram

Binary file not shown.