From 40cde41b69d575ea7b7bca741572e14dc6214f50 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sun, 28 Apr 2024 08:38:55 +0200 Subject: [PATCH] cleaning --- cold.c | 53 ++++++++++++++++++++++++++++-------- cold.h | 11 ++------ exec.o | Bin 27936 -> 27920 bytes hot.h | 45 +++++++++++++++++++++++++++++++ main.c | 83 +-------------------------------------------------------- warm.c | 1 - warm.h | 11 +------- 7 files changed, 91 insertions(+), 113 deletions(-) diff --git a/cold.c b/cold.c index 46a10da..0ccb968 100644 --- a/cold.c +++ b/cold.c @@ -3,17 +3,13 @@ void print_text(GtkWidget *widget, gpointer data) {g_print (data);} -void button_0(GtkWindow *window, GtkWidget *grid, int x, int y, int w, int h){ - GtkWidget *button_0 = gtk_button_new_with_label ("Quit"); - g_signal_connect (button_0, "clicked", G_CALLBACK (print_text), "bye !...\n"); - g_signal_connect_swapped (button_0, "clicked", G_CALLBACK (gtk_window_destroy), window); - gtk_grid_attach (GTK_GRID (grid), button_0, x, y, w, h); -} - -void button_1(GtkWidget *grid, int x, int y, int w, int h){ - GtkWidget *button_1 = gtk_button_new_with_label ("bouton (I)"); - g_signal_connect (button_1, "clicked", G_CALLBACK (print_text), "n°1\n"); - gtk_grid_attach (GTK_GRID (grid), button_1, x, y, w, h); +void click_print_do (GtkWindow *window, GtkWidget *grid, + char *label, char *text, int x, int y, int w, int h){ + GtkWidget *button = gtk_button_new_with_label (label); + gtk_grid_attach (GTK_GRID (grid), button, x, y, w, h); + g_signal_connect (button, "clicked", G_CALLBACK (print_text), text); + if (window) + g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window); } void window_bar(GtkWindow *window, char *title){ @@ -27,3 +23,38 @@ void window_grid(GtkWindow *window){ gtk_window_set_child (window, grid); } +/*----------------------------------------------------------------------------*/ + +/* GtkBox GtkGrid GtkRevealer GtkStack + * GtkOverlay GtkPaned GtkExpander GtkFixed */ + +/* GtkBox + * int spacing = 8; + * box = gtk_box_new (0, spacing); + * 0 = GTK_ORIENTATION_HORIZONTAL, 1 = GTK_ORIENTATION_VERTICAL + * 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); + * 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 */ + + + +/* TODO or NOT TODO + * + * GtkRevealer *revealer = gtk_revealer_new(); + * gtk_revealer_set_child (GTK_ ? (revealer), box); + * gtk_revealer_set_transition_type (revealer, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN); + * + */ + +// GtkWidget *overlay = gtk_overlay_new(); +// gtk_overlay_set_buildable_id (GTK_BUILDABLE(overlay), "overlay id"); +// printf("overlay %s\n", gtk_buildable_get_buildable_id (GTK_BUILDABLE(overlay))); + +// how do I attach a widget to a page ? + diff --git a/cold.h b/cold.h index 240b5c7..99bb475 100644 --- a/cold.h +++ b/cold.h @@ -2,15 +2,8 @@ #include void print_text(GtkWidget *widget, gpointer data); -void button_0(GtkWindow *window, GtkWidget *grid, int x, int y, int w, int h); -void button_1(GtkWidget *grid, int x, int y, int w, int h); +void click_print_do (GtkWindow *window, GtkWidget *grid, + char *label, char *text, int x, int y, int w, int h); void window_bar(GtkWindow *window, char *title); void window_grid(GtkWindow *window); -/* -GtkWidget *button_2 = gtk_button_new_with_label ("II"); -GtkWidget *button_3 = gtk_button_new_with_label ("III"); -GtkWidget *button_4 = gtk_button_new_with_label ("IV"); -GtkWidget *button_5 = gtk_button_new_with_label ("V"); -*/ -// GtkToggleButton *tb1 = GTK_TOGGLE_BUTTON (gtk_button_new_with_label ("tb1")); diff --git a/exec.o b/exec.o index aebdf049c88e7807219366e63d41dae49ea4a83f..d40bad1e0ba497086c3bbd903dd3a799ff7042cf 100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j1J*3pjF?q$7i?;!GiAa6ExLXokBe5J0&BSGTL= z!8+%lJ<#Z;K)z~z&TRp37cPL-9Y#KM;~b#@;O+|KbC&1abHEqmGOW+JXrK|~U^eI6 sK5*o&KtOB #include +#include "warm.h" +#include "cold.h" + +void activate (GtkApplication *app, gpointer user_data) { + GtkWindow *window = GTK_WINDOW (gtk_application_window_new (app)); + GtkWidget *grid = gtk_grid_new(); + + click_print_do (NULL, grid, "(I)", "n°1\n", 0,0,1,1); + click_print_do (NULL, grid, "(II)", "n°2\n", 1,0,1,1); + click_print_do (window, grid, "Quit", "bye !...\n", 2,0,1,2); + + + GtkWidget *switcher = gtk_stack_switcher_new(); +// GtkWidget *sidebar = gtk_stack_sidebar_new(); + GtkStack *stack = GTK_STACK (gtk_stack_new()); + GtkWidget *page_0 = gtk_paned_new(GTK_ORIENTATION_VERTICAL); + GtkWidget *page_1 = gtk_paned_new(GTK_ORIENTATION_VERTICAL); + GtkWidget *box_1 = gtk_box_new (0, 6); // 6 = spacing + + window_bar (window, "window"); + gtk_window_set_child (window, grid); + + gtk_stack_add_titled (stack, page_0, "n°0", "A"); + gtk_stack_add_titled (stack, page_1, "n°1", "B"); + GtkStackPage *page_2 = gtk_stack_add_titled (stack, box_1, "any name", "C"); + gtk_stack_page_set_name (page_2, "n°2"); + +// gtk_grid_attach (GTK_GRID (grid_1), button_5, 0, 0, 1, 1); + + gtk_orientable_set_orientation (GTK_ORIENTABLE (switcher), GTK_ORIENTATION_VERTICAL); + gtk_orientable_set_orientation (GTK_ORIENTABLE (switcher), GTK_ORIENTATION_HORIZONTAL); + + gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (switcher), stack); +// gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), stack); + + GtkSelectionModel *stack_selection_model = gtk_stack_get_pages (stack); + gtk_selection_model_select_item (stack_selection_model, 2, 1); + + printf("selected page name is [%s] (how do I get its title ?)\n", + gtk_stack_get_visible_child_name (stack)); +// gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_CROSSFADE); + + gtk_grid_attach (GTK_GRID (grid), switcher, 0, 2, 2, 1); + gtk_window_present (GTK_WINDOW (window)); +} diff --git a/main.c b/main.c index 32e4ae0..b5a1712 100644 --- a/main.c +++ b/main.c @@ -1,51 +1,6 @@ -#include #include "hot.h" -#include "warm.h" -#include "cold.h" - -static void activate (GtkApplication *app, gpointer user_data) { - GtkWindow *window = GTK_WINDOW (gtk_application_window_new (app)); - GtkWidget *switcher = gtk_stack_switcher_new(); -// GtkWidget *sidebar = gtk_stack_sidebar_new(); - GtkStack *stack = GTK_STACK (gtk_stack_new()); - GtkWidget *page_0 = gtk_paned_new(GTK_ORIENTATION_VERTICAL); - GtkWidget *page_1 = gtk_paned_new(GTK_ORIENTATION_VERTICAL); - GtkWidget *grid = gtk_grid_new(); - GtkWidget *box_1 = gtk_box_new (0, 6); // 6 = spacing - - window_bar (window, "window"); - gtk_window_set_child (window, grid); - button_0 (window, grid, 1,0,1,1); - button_1 (grid, 0,0,1,1); - - gtk_stack_add_titled (stack, page_0, "n°0", "A"); - gtk_stack_add_titled (stack, page_1, "n°1", "B"); - GtkStackPage *page_2 = gtk_stack_add_titled (stack, box_1, "any name", "C"); - gtk_stack_page_set_name (page_2, "n°2"); - -// gtk_grid_attach (GTK_GRID (grid_1), button_5, 0, 0, 1, 1); - - gtk_orientable_set_orientation (GTK_ORIENTABLE (switcher), GTK_ORIENTATION_VERTICAL); - gtk_orientable_set_orientation (GTK_ORIENTABLE (switcher), GTK_ORIENTATION_HORIZONTAL); - - gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (switcher), stack); -// gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), stack); - - GtkSelectionModel *stack_selection_model = gtk_stack_get_pages (stack); - gtk_selection_model_select_item (stack_selection_model, 2, 1); - - printf("selected page name is [%s] (how do I get its title ?)\n", - gtk_stack_get_visible_child_name (stack)); -// gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_CROSSFADE); - - gtk_grid_attach (GTK_GRID (grid), switcher, 0, 2, 2, 1); - gtk_window_present (GTK_WINDOW (window)); -} - -int -main (int argc, - char **argv) +int main (int argc, char **argv) { GtkApplication *app; int status; @@ -57,39 +12,3 @@ main (int argc, return status; } - -/* GtkBox GtkGrid GtkRevealer GtkStack - * GtkOverlay GtkPaned GtkExpander GtkFixed */ - -/* GtkBox - * int spacing = 8; - * box = gtk_box_new (0, spacing); - * 0 = GTK_ORIENTATION_HORIZONTAL, 1 = GTK_ORIENTATION_VERTICAL - * 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); - * 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 */ - - - - - -/* TODO or NOT TODO - * - * GtkRevealer *revealer = gtk_revealer_new(); - * gtk_revealer_set_child (GTK_ ? (revealer), box); - * gtk_revealer_set_transition_type (revealer, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN); - * - */ - -// GtkWidget *overlay = gtk_overlay_new(); -// gtk_overlay_set_buildable_id (GTK_BUILDABLE(overlay), "overlay id"); -// printf("overlay %s\n", gtk_buildable_get_buildable_id (GTK_BUILDABLE(overlay))); - -// how do I attach a widget to a page ? - diff --git a/warm.c b/warm.c index 4debdbb..5e653bb 100644 --- a/warm.c +++ b/warm.c @@ -1,4 +1,3 @@ -//#pragma once #include #include #include diff --git a/warm.h b/warm.h index 6a820f8..08945a4 100644 --- a/warm.h +++ b/warm.h @@ -12,14 +12,5 @@ #include #include #include +#include "cold.h" -/* -extern GtkWidget *button_0; -extern GtkWidget *button_1; -extern GtkWidget *button_2; -extern GtkWidget *button_3; -extern GtkWidget *button_4; -extern GtkWidget *button_5; - -void print_text(char *text); -*/