pourquoi les contenus de la stack ne sont-ils pas visibles ?
This commit is contained in:
parent
bb8fa442a7
commit
6c2fbc3eaf
14
cold.c
14
cold.c
|
@ -38,6 +38,20 @@ void window_bar(GtkWindow *window, char *title){
|
||||||
button = gtk_button_new_with_label (" I "); n fois
|
button = gtk_button_new_with_label (" I "); n fois
|
||||||
gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1); n fois */
|
gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1); n fois */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gtk_paned_new (GTK_ORIENTATION_VERTICAL or GTK_ORIENTATION_VERTICAL)
|
||||||
|
* GtkPaned has two panes, arranged either horizontally or vertically.
|
||||||
|
* The division between the two panes is adjustable by the user by dragging a handle.
|
||||||
|
* Child widgets are added to the panes of the widget
|
||||||
|
* with gtk_paned_pack1() and gtk_paned_pack2().
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GtkWidget* gtk_box_new (GtkOrientation orientation, gint spacing)
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* TODO or NOT TODO
|
/* TODO or NOT TODO
|
||||||
|
|
1
hot.c
1
hot.c
|
@ -1,4 +1,3 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <gtk-4.0/gtk/gtk.h>
|
#include <gtk-4.0/gtk/gtk.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
37
hot.h
37
hot.h
|
@ -11,33 +11,46 @@ void activate (GtkApplication *app, gpointer user_data) {
|
||||||
|
|
||||||
click_print_do (NULL, grid, "(I)", "n°1\n", 0,0,1,1);
|
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 (NULL, grid, "(II)", "n°2\n", 1,0,1,1);
|
||||||
click_print_do (window, grid, "Quit", "bye !\n", 2,0,1,2);
|
click_print_do (window, grid, "Quit", "bye !\n", 2,0,1,1);
|
||||||
|
|
||||||
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, 2, 2, 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);
|
||||||
gtk_stack_add_titled (stack, page_0, "n°0", "A");
|
GtkWidget *box_0 = gtk_box_new (0, 0);
|
||||||
gtk_stack_add_titled (stack, page_1, "n°1", "B");
|
GtkWidget *box_1 = gtk_box_new (0, 0);
|
||||||
|
GtkWidget *box_2 = gtk_box_new (0, 0);
|
||||||
|
GtkWidget *box_3 = gtk_box_new (0, 0);
|
||||||
|
gtk_box_append (GTK_BOX (box_0), gtk_button_new_with_label ("00"));
|
||||||
|
gtk_box_append (GTK_BOX (box_0), gtk_button_new_with_label ("01"));
|
||||||
|
gtk_box_append (GTK_BOX (box_1), gtk_button_new_with_label ("10"));
|
||||||
|
gtk_box_append (GTK_BOX (box_1), gtk_button_new_with_label ("11"));
|
||||||
|
gtk_box_append (GTK_BOX (box_2), gtk_button_new_with_label ("20"));
|
||||||
|
gtk_box_append (GTK_BOX (box_2), gtk_button_new_with_label ("21"));
|
||||||
|
gtk_box_append (GTK_BOX (box_3), gtk_button_new_with_label ("30"));
|
||||||
|
gtk_box_append (GTK_BOX (box_3), gtk_button_new_with_label ("31"));
|
||||||
|
gtk_stack_add_titled (stack, box_0, "n°0", "A");
|
||||||
|
gtk_stack_add_titled (stack, box_1, "n°1", "B");
|
||||||
|
gtk_stack_add_titled (stack, box_2, "n°2", "C");
|
||||||
|
gtk_grid_attach (GTK_GRID (grid), box_3, 0, 2, 1, 1);
|
||||||
|
|
||||||
GtkWidget *box_1 = gtk_box_new (0, 6); // 6 = spacing
|
|
||||||
|
|
||||||
GtkStackPage *page_2 = gtk_stack_add_titled (stack, box_1, "any name", "C");
|
// GtkStackPage *page_2 = gtk_stack_add_titled (stack, box_1, "any name", "C");
|
||||||
gtk_stack_page_set_name (page_2, "n°2");
|
// gtk_stack_page_set_name (page_2, "n°2");
|
||||||
|
|
||||||
|
GtkSelectionModel *stack_selection_model = gtk_stack_get_pages (stack);
|
||||||
|
gtk_selection_model_select_item (stack_selection_model, 1, 1);
|
||||||
|
|
||||||
printf("selected page name is [%s] (how do I get its title ?)\n",
|
printf("selected page name is [%s] (how do I get its title ?)\n",
|
||||||
gtk_stack_get_visible_child_name (stack));
|
gtk_stack_get_visible_child_name (stack));
|
||||||
|
|
||||||
GtkSelectionModel *stack_selection_model = gtk_stack_get_pages (stack);
|
|
||||||
gtk_selection_model_select_item (stack_selection_model, 2, 1);
|
|
||||||
|
|
||||||
// gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_CROSSFADE);
|
// gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_CROSSFADE);
|
||||||
|
|
||||||
gtk_window_present (GTK_WINDOW (window));
|
gtk_window_present (GTK_WINDOW (window));
|
||||||
|
|
11
warm.c
11
warm.c
|
@ -1,14 +1,3 @@
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <gtk-4.0/gtk/gtk.h>
|
#include <gtk-4.0/gtk/gtk.h>
|
||||||
|
|
||||||
/* button_0 = gtk_button_new_with_label ("Quit");
|
|
||||||
GtkWidget *button_1 = gtk_button_new_with_label ("I");
|
|
||||||
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"));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue