WIP: toujours perdu...

This commit is contained in:
Jean Sirmai 2024-06-19 10:46:26 +02:00
parent 270b2feba5
commit 5c5bd709d9
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 20 additions and 18 deletions

View File

@ -177,26 +177,28 @@ void window_header_bar (GtkWindow *main_window, char *title){
GtkWidget *any_Label = GTK_WIDGET (gtk_label_new (" | "));
// https://docs.gtk.org/gtk4/class.Stack.html
GtkWidget *a_switcher = gtk_stack_switcher_new ();
GtkWidget *a_stack = gtk_stack_new ();
GtkStackPage* stack_child_space = gtk_stack_add_child (GTK_STACK (a_stack), GTK_WIDGET (get_STATE_VIEW_box()));
GtkStackPage* stack_child_rules = gtk_stack_add_child (GTK_STACK (a_stack), GTK_WIDGET (get_edit_rules_page_new()));
GtkStackPage* stack_child_data = gtk_stack_add_child (GTK_STACK (a_stack), GTK_WIDGET (get_measures_page_new()));
GtkWidget *switcher_SRD = gtk_stack_switcher_new ();
GtkWidget *stack_SRD = gtk_stack_new ();
gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (switcher_SRD), GTK_STACK (stack_SRD));
gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (a_switcher), GTK_STACK (a_stack));
gtk_stack_add_titled (GTK_STACK (a_stack), GTK_WIDGET (get_STATE_VIEW_box()), "a_name", "space");
gtk_stack_add_titled (GTK_STACK (a_stack), GTK_WIDGET (get_edit_rules_page_new()), "another_name", "rules");
gtk_stack_add_titled (GTK_STACK (a_stack), GTK_WIDGET (get_measures_page_new()), "a_third_name", "data analysis");
// GtkStackPage* page_child_space = gtk_stack_add_child (GTK_STACK (stack_SRD), GTK_WIDGET (get_STATE_VIEW_box()));
// GtkStackPage* page_child_rules = gtk_stack_add_child (GTK_STACK (stack_SRD), GTK_WIDGET (get_edit_rules_page_new()));
// GtkStackPage* page_child_data = gtk_stack_add_child (GTK_STACK (stack_SRD), GTK_WIDGET (get_measures_page_new()));
// gtk_stack_page_set_visible (*self, TRUE);
// gtk_window_set_child (main_window, GTK_WIDGET (gtk_stack_get_visible_child (GTK_STACK (a_stack))));
gtk_stack_set_visible_child (GTK_STACK (a_stack), GTK_WIDGET (get_STATE_VIEW_box()));
gtk_stack_set_visible_child (GTK_STACK (a_stack), GTK_WIDGET (get_edit_rules_page_new()));
gtk_widget_set_visible (GTK_WIDGET (get_edit_rules_page_new()), TRUE);
gtk_stack_add_titled (GTK_STACK (stack_SRD), GTK_WIDGET (get_STATE_VIEW_box()), "name_space", "space");
gtk_stack_add_titled (GTK_STACK (stack_SRD), GTK_WIDGET (get_edit_rules_page_new()), "name_rules", "rules");
gtk_stack_add_titled (GTK_STACK (stack_SRD), GTK_WIDGET (get_measures_page_new()), "name_data", "data analysis");
// gtk_stack_page_set_visible (page_child_space, TRUE);
// gtk_widget_set_visible (GTK_WIDGET (page_child_rules), TRUE);
// gtk_stack_set_visible_child (GTK_STACK (stack_SRD), GTK_WIDGET (page_child_space));
// gtk_stack_set_visible_child (GTK_STACK (stack_SRD), GTK_WIDGET (page_child_rules));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_XOR_EXEC_EDIT));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (any_Label));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (a_switcher));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (switcher_SRD));
gtk_window_set_child (main_window, GTK_WIDGET (get_STATE_VIEW_box()));
}
void window_main_child (GtkWindow *main_window, int selected_page){
@ -366,8 +368,8 @@ void window_header_bar (GtkWindow *window, char *title){
// https://docs.gtk.org/gobject/tutorial.html#how-to-define-and-implement-a-new-gobject
GtkWidget *a_stack = gtk_stack_new ();
GtkWidget *a_switcher = gtk_stack_switcher_new ();
gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (a_switcher), GTK_STACK (a_stack));
GtkWidget *switcher_SRD = gtk_stack_switcher_new ();
gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (switcher_SRD), GTK_STACK (a_stack));
gtk_stack_add_titled (GTK_STACK (a_stack), GTK_WIDGET (page_box), "a_name", "space");
// gtk_stack_page_set_visible (*self, TRUE);
@ -377,7 +379,7 @@ void window_header_bar (GtkWindow *window, char *title){
// gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_STATE));
// gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_RULES));
// gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_open_DATA));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (a_switcher));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (switcher_SRD));
// icons_for_fun (GTK_HEADER_BAR (header_bar)); // https://iconduck.com/sets/adwaita-icon-theme
}