[gtk+] Make subsurface test use a stack
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make subsurface test use a stack
- Date: Wed, 17 Sep 2014 16:42:50 +0000 (UTC)
commit 4d835f61a54aa471b1949ee6b78e6868673d0b50
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Sep 17 12:42:32 2014 -0400
Make subsurface test use a stack
Just to show that it works.
tests/subsurface.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/tests/subsurface.c b/tests/subsurface.c
index bfd0ea7..9f8f9c4 100644
--- a/tests/subsurface.c
+++ b/tests/subsurface.c
@@ -89,19 +89,26 @@ int
main (int argc, char *argv[])
{
GtkWidget *window, *label, *box, *widget;
+ GtkWidget *stack, *switcher;
gtk_init (NULL, NULL);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-
gtk_container_add (GTK_CONTAINER (window), box);
+
+ stack = gtk_stack_new ();
+ switcher = gtk_stack_switcher_new ();
+ gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (switcher), GTK_STACK (stack));
+ gtk_container_add (GTK_CONTAINER (box), switcher);
+ gtk_container_add (GTK_CONTAINER (box), stack);
+
label = gtk_label_new ("Test test");
- gtk_container_add (GTK_CONTAINER (box), label);
+ gtk_stack_add_titled (GTK_STACK (stack), label, "1", "One");
widget = da_new ();
gtk_widget_set_size_request (widget, 100, 100);
- gtk_container_add (GTK_CONTAINER (box), widget);
+ gtk_stack_add_titled (GTK_STACK (stack), widget, "2", "Two");
gtk_widget_show_all (window);
gtk_main ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]