2016-11-03 12:32:31 +00:00
|
|
|
#include <gtk/gtk.h>
|
2017-03-12 18:36:21 +00:00
|
|
|
#include <glib/gstdio.h>
|
2016-11-03 12:32:31 +00:00
|
|
|
|
|
|
|
static GtkWidget *header_stack;
|
|
|
|
static GtkWidget *page_stack;
|
|
|
|
|
2019-11-29 07:48:48 +00:00
|
|
|
void
|
2016-11-03 12:32:31 +00:00
|
|
|
back_to_main (GtkButton *button)
|
|
|
|
{
|
|
|
|
gtk_stack_set_visible_child_name (GTK_STACK (header_stack), "main");
|
|
|
|
gtk_stack_set_visible_child_name (GTK_STACK (page_stack), "page1");
|
|
|
|
}
|
|
|
|
|
2019-11-29 07:48:48 +00:00
|
|
|
void
|
2016-11-03 12:32:31 +00:00
|
|
|
go_to_secondary (GtkButton *button)
|
|
|
|
{
|
|
|
|
gtk_stack_set_visible_child_name (GTK_STACK (header_stack), "secondary");
|
|
|
|
gtk_stack_set_visible_child_name (GTK_STACK (page_stack), "secondary");
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
GtkBuilder *builder;
|
|
|
|
GtkWidget *win;
|
|
|
|
|
2017-03-12 18:36:21 +00:00
|
|
|
#ifdef GTK_SRCDIR
|
|
|
|
g_chdir (GTK_SRCDIR);
|
|
|
|
#endif
|
|
|
|
|
2016-12-28 13:53:22 +00:00
|
|
|
gtk_init ();
|
2016-11-03 12:32:31 +00:00
|
|
|
|
|
|
|
builder = gtk_builder_new ();
|
|
|
|
gtk_builder_add_from_file (builder, "teststackedheaders.ui", NULL);
|
|
|
|
|
|
|
|
win = (GtkWidget *)gtk_builder_get_object (builder, "window");
|
|
|
|
header_stack = (GtkWidget *)gtk_builder_get_object (builder, "header_stack");
|
|
|
|
page_stack = (GtkWidget *)gtk_builder_get_object (builder, "page_stack");
|
|
|
|
|
|
|
|
gtk_window_present (GTK_WINDOW (win));
|
|
|
|
|
2020-02-10 03:24:47 +00:00
|
|
|
while (TRUE)
|
|
|
|
g_main_context_iteration (NULL, TRUE);
|
2016-11-03 12:32:31 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|