space page : a first approach

This commit is contained in:
Jean Sirmai 2024-04-30 07:17:00 +02:00
parent d0e04d4901
commit af5f4cfc11
Signed by: jean
GPG Key ID: FB3115C340E057E3
5 changed files with 22 additions and 10 deletions

View File

@ -21,11 +21,9 @@ exec.o: hot.c warm.c cold.c main.c Makefile
clean: clean:
rm -f exec.o rm -f exec.o
# Builder will call this to install the application before running.
install: install:
echo "Installing is not supported" echo "Installing is not supported"
# Builder uses this target to run your application.
run: exec.o run: exec.o
./exec.o ./exec.o

BIN
exec.o

Binary file not shown.

16
hot.c
View File

@ -6,7 +6,21 @@
GtkWidget *get_space_page_new(){ GtkWidget *get_space_page_new(){
GtkWidget *space_grid = gtk_grid_new(); GtkWidget *space_grid = gtk_grid_new();
gtk_grid_attach (GTK_GRID(space_grid), gtk_button_new_with_label ("Hi babe...here am I !"), 0, 0, 1, 1);
GtkDrawingArea *surface = GTK_DRAWING_AREA(gtk_drawing_area_new ());
gtk_drawing_area_set_content_width (surface, 640);
gtk_drawing_area_set_content_height (surface, 600);
gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(surface), 0, 0, 1, 1);
GtkBox *XYZ_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); // spacing = 2
gtk_box_append (XYZ_box, gtk_button_new_with_label ("X"));
gtk_box_append (XYZ_box, gtk_button_new_with_label ("Y"));
gtk_box_append (XYZ_box, gtk_button_new_with_label ("Z"));
gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(XYZ_box), 1, 0, 1, 1);
gtk_grid_attach (GTK_GRID(space_grid), gtk_button_new_with_label ("RUN / STOP (and all that stuff...)"), 0, 1, 2, 1);
gtk_grid_attach (GTK_GRID(space_grid), gtk_button_new_with_label ("Objects / Situations (transparences)"), 0, 2, 2, 1);
gtk_grid_attach (GTK_GRID(space_grid), gtk_button_new_with_label ("camera (zoom...)"), 0, 3, 2, 1);
return space_grid; return space_grid;
} }

4
warm.c
View File

@ -8,8 +8,8 @@ GtkWidget *get_measures_page_new(){
gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("movements"), 0, 0, 1, 1); gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("movements"), 0, 0, 1, 1);
gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("transports"), 1, 0, 1, 1); gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("transports"), 1, 0, 1, 1);
gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("transformations"), 2, 0, 1, 1); gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("transformations"), 2, 0, 1, 1);
gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("objects counts"), 0, 1, 1, 1); gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("objects"), 0, 1, 1, 1);
gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("situations counts"), 1, 1, 1, 1); gtk_grid_attach (GTK_GRID (measures_grid), gtk_button_new_with_label ("situations"), 1, 1, 1, 1);
return measures_grid; return measures_grid;
} }

8
warm.h
View File

@ -20,16 +20,16 @@
* https://stackoverflow.com/questions/20122232/gtklistc-code-how-to-get-the-selection-of-a-gtklist * https://stackoverflow.com/questions/20122232/gtklistc-code-how-to-get-the-selection-of-a-gtklist
* *
GtkWidget *switcher = gtk_stack_switcher_new(); GtkWidget *switcher = gtk_stack_switcher_new();
// GtkWidget *sidebar = gtk_stack_sidebar_new(); GtkWidget *sidebar = gtk_stack_sidebar_new();
gtk_grid_attach (GTK_GRID (grid), switcher, 0, 1, 3, 1); gtk_grid_attach (GTK_GRID (grid), switcher, 0, 1, 3, 1);
gtk_orientable_set_orientation (GTK_ORIENTABLE (switcher), GTK_ORIENTATION_VERTICAL); gtk_orientable_set_orientation (GTK_ORIENTABLE (switcher), GTK_ORIENTATION_VERTICAL);
gtk_orientable_set_orientation (GTK_ORIENTABLE (switcher), GTK_ORIENTATION_HORIZONTAL); gtk_orientable_set_orientation (GTK_ORIENTABLE (switcher), GTK_ORIENTATION_HORIZONTAL);
GtkStack *stack = GTK_STACK (gtk_stack_new()); GtkStack *stack = GTK_STACK (gtk_stack_new());
gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (switcher), stack); gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (switcher), stack);
// gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), stack); gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), stack);
// GtkWidget *page_0 = gtk_paned_new(GTK_ORIENTATION_VERTICAL); GtkWidget *page_0 = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
// GtkWidget *page_1 = gtk_paned_new(GTK_ORIENTATION_VERTICAL); GtkWidget *page_1 = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
GtkWidget *box_0 = gtk_box_new (0, 0); GtkWidget *box_0 = gtk_box_new (0, 0);
GtkWidget *box_1 = gtk_box_new (0, 0); GtkWidget *box_1 = gtk_box_new (0, 0);
GtkWidget *box_2 = gtk_box_new (0, 0); GtkWidget *box_2 = gtk_box_new (0, 0);