scrolling many objects and situations in the bottom horizontal pane

This commit is contained in:
Jean Sirmai 2024-05-10 23:56:28 +02:00
parent bb0379bb08
commit 8e4be2ff08
Signed by: jean
GPG Key ID: FB3115C340E057E3
4 changed files with 17 additions and 6 deletions

View File

@ -11,7 +11,7 @@
#define H 960
#define W_IMAGE 1920 - 320
#define H_IMAGE 960 - 126
#define H_STYLES_PANE 60
#define H_STYLES_PANE 30
void activate (GtkApplication *app, gpointer user_data);

View File

@ -112,23 +112,34 @@ GtkProgressBar *get_ELAPSED_TIME_ProgressBar(){ // To rename : DO - UNDO - REDO
static GtkBox *get_objects_box(){
GtkBox *objects_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
GtkAdjustment *adjust = gtk_adjustment_new (0, 0, 255, 1, 0, 0);
if (0) for (int i = 0; i < 10; i++)
gtk_box_append (objects_box, gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adjust));
char string[7];
for (int i = 0; i < 16; i++){
sprintf(string, "[%d] ", i);
if (0) printf("%s\n", string); // répété deux fois ! pourquoi ?
gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (string)));
}
gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" membrane ")));
gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" co-enzyme A ")));
gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" ribosome ")));
gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" cytochrome C ")));
gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" ATP synthase ")));
gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" chromosome ")));
return objects_box;
}
static GtkBox *get_situations_box(){
GtkBox *situations_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
char string[7];
for (int i = 0; i < 64; i++){
sprintf(string, "[%d] ", i);
if (0) printf("%s\n", string); // répété deux fois ! pourquoi ?
gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (string)));
}
gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" transcription ")));
gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" activation opéron lactose ")));
gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" translation ")));
gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" transport Na/K ")));
gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" ubiquitination ")));
gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" rotation du moteur flagellaire ")));
gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" rotation moteur flagellaire ")));
return situations_box;
}

BIN
display.o

Binary file not shown.

BIN
myprogram

Binary file not shown.