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;
|
|
|
|
|
2020-03-06 17:05:43 +00:00
|
|
|
#if 0
|
|
|
|
static 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");
|
|
|
|
}
|
|
|
|
|
2020-03-06 17:05:43 +00:00
|
|
|
static 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");
|
|
|
|
}
|
2020-03-06 17:05:43 +00:00
|
|
|
#endif
|
2016-11-03 12:32:31 +00:00
|
|
|
|
|
|
|
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");
|
|
|
|
|
2020-03-06 17:05:43 +00:00
|
|
|
g_assert (header_stack);
|
|
|
|
|
2016-11-03 12:32:31 +00:00
|
|
|
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;
|
|
|
|
}
|