diff --git a/(notes) b/(notes) new file mode 100644 index 0000000..266d77a --- /dev/null +++ b/(notes) @@ -0,0 +1,31 @@ +-------------------------------------------------------------------------------- +https://docs.gtk.org/gtk4/visual_index.html widgets gallery +https://forge.a-lec.org/gem-graph/gem-graph-client/src/branch/devel/Makefile +https://docs.gtk.org/gtk4/class.Widget.html#height-for-width-geometry-management +https://docs.gtk.org/gtk4/drag-and-drop.html drag-and-drop +https://docs.gtk.org/gtk4/class.GestureZoom.html GtkGestureZoom +-------------------------------------------------------------------------------- + +GTK_ORIENTATION_VERTICAL GTK_ORIENTATION_HORIZONTAL + +g_signal_connect (button, "clicked", G_CALLBACK (printf("%s\n", text)), text); +g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window); + +-------------------------------------------------------------------------------- + +GtkBox GtkGrid GtkRevealer GtkStack +GtkOverlay GtkPaned GtkExpander GtkFixed + +box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); +gtk_widget_set_halign (box, GTK_ALIGN_FILL); +gtk_widget_set_valign (box, GTK_ALIGN_CENTER); // START CENTER END FILL +gtk_window_set_child (GTK_WINDOW (window), box); +puis, après déclaration du bouton, gtk_box_append (GTK_BOX (box), button); + +grid = gtk_grid_new (); +gtk_window_set_child (GTK_WINDOW (window), grid); +button = gtk_button_new_with_label (" I "); n fois +gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1); n fois + +-------------------------------------------------------------------------------- + diff --git a/myprogram b/myprogram index afcc147..ffb49ff 100755 Binary files a/myprogram and b/myprogram differ diff --git a/pages.c b/pages.c index d4ae2e3..c3b8f97 100644 --- a/pages.c +++ b/pages.c @@ -166,12 +166,3 @@ void activate (GtkApplication *app, gpointer user_data) { gtk_window_present (GTK_WINDOW (window)); } -/* REM ! - * g_signal_connect (button, "clicked", G_CALLBACK (printf("%s\n", text)), text); - * g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window); - * - * drag-and-drop https://docs.gtk.org/gtk4/drag-and-drop.html - * - * GtkGestureZoom https://docs.gtk.org/gtk4/class.GestureZoom.html - */ - diff --git a/warm.o b/warm.o index 6fac906..457afbf 100644 Binary files a/warm.o and b/warm.o differ diff --git a/widgets.c b/widgets.c index 0309a5b..76dbc11 100644 --- a/widgets.c +++ b/widgets.c @@ -16,7 +16,7 @@ GtkWidget *get_test_image(){ image = gtk_image_new_from_file("/home/jean/01/Gtk4/Getting_Started_with_GTK/image aXoris.png"); image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image gg sketch.png"); image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image E coli (Goodsell).png"); - gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE, NULL); + gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE, 0); return image; } @@ -35,7 +35,7 @@ GtkBox *get_ZOOM_box(){ GtkBox *get_edit_TOOL_box(){ GtkBox *TOOL_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); GtkWidget *ZOOM_Label = GTK_WIDGET (gtk_label_new ("TOOLS\n ---\n(space\nstruct.)")); -// gtk_widget_set_size_request (GTK_WIDGET (TOOL_box), 30, 80); + gtk_widget_set_size_request (GTK_WIDGET (TOOL_box), 30, 120); gtk_box_append (TOOL_box, ZOOM_Label); return TOOL_box; } @@ -53,7 +53,7 @@ GtkBox *get_XYZ_box(){ 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_widget_set_size_request (GTK_WIDGET (scroll_X), 1, 400); + gtk_widget_set_size_request (GTK_WIDGET (scroll_X), 1, 250); gtk_box_append (XYZ_scrollbar_box, GTK_WIDGET (gtk_label_new (" "))); // AD HOC (pour "centrer") gtk_box_append (XYZ_scrollbar_box, scroll_X); diff --git a/widgets.o b/widgets.o index 1502a1b..44492cb 100644 Binary files a/widgets.o and b/widgets.o differ