summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-04-21 17:52:33 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-04-21 17:52:33 +0000
commit8d30ad28380432c6af894fa397b16ff86896bcd1 (patch)
tree8bb28e25be1276aff0158832f1e083dc9ebc1907
parent4d74836ad06c45f8d340e98cf61a75fc93ec1f82 (diff)
downloadgdk-pixbuf-8d30ad28380432c6af894fa397b16ff86896bcd1.tar.gz
A new demo.
2004-04-21 Matthias Clasen <mclasen@redhat.com> * demos/gtk-demo/expander.c (do_expander): A new demo. * demos/gtk-demo/Makefile.am (demos): Add expander.c.
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.pre-2-106
-rw-r--r--ChangeLog.pre-2-46
-rw-r--r--ChangeLog.pre-2-66
-rw-r--r--ChangeLog.pre-2-86
-rw-r--r--demos/gtk-demo/Makefile.am1
-rw-r--r--demos/gtk-demo/expander.c59
7 files changed, 90 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index e14b21d80..f92166f3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-04-21 Matthias Clasen <mclasen@redhat.com>
+
+ * demos/gtk-demo/expander.c (do_expander): A new demo.
+
+ * demos/gtk-demo/Makefile.am (demos): Add expander.c.
+
2004-04-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextview.c (gtk_text_view_allocate_children): Make
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index e14b21d80..f92166f3e 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,9 @@
+2004-04-21 Matthias Clasen <mclasen@redhat.com>
+
+ * demos/gtk-demo/expander.c (do_expander): A new demo.
+
+ * demos/gtk-demo/Makefile.am (demos): Add expander.c.
+
2004-04-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextview.c (gtk_text_view_allocate_children): Make
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index e14b21d80..f92166f3e 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,9 @@
+2004-04-21 Matthias Clasen <mclasen@redhat.com>
+
+ * demos/gtk-demo/expander.c (do_expander): A new demo.
+
+ * demos/gtk-demo/Makefile.am (demos): Add expander.c.
+
2004-04-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextview.c (gtk_text_view_allocate_children): Make
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index e14b21d80..f92166f3e 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,9 @@
+2004-04-21 Matthias Clasen <mclasen@redhat.com>
+
+ * demos/gtk-demo/expander.c (do_expander): A new demo.
+
+ * demos/gtk-demo/Makefile.am (demos): Add expander.c.
+
2004-04-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextview.c (gtk_text_view_allocate_children): Make
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index e14b21d80..f92166f3e 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,9 @@
+2004-04-21 Matthias Clasen <mclasen@redhat.com>
+
+ * demos/gtk-demo/expander.c (do_expander): A new demo.
+
+ * demos/gtk-demo/Makefile.am (demos): Add expander.c.
+
2004-04-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextview.c (gtk_text_view_allocate_children): Make
diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am
index d79ba0169..c139feb3d 100644
--- a/demos/gtk-demo/Makefile.am
+++ b/demos/gtk-demo/Makefile.am
@@ -13,6 +13,7 @@ demos = \
drawingarea.c \
editable_cells.c \
entry_completion.c \
+ expander.c \
hypertext.c \
images.c \
list_store.c \
diff --git a/demos/gtk-demo/expander.c b/demos/gtk-demo/expander.c
new file mode 100644
index 000000000..bc52a9683
--- /dev/null
+++ b/demos/gtk-demo/expander.c
@@ -0,0 +1,59 @@
+/* Expander
+ *
+ * GtkExpander allows to provide additional content that is initially hidden.
+ * This is also known as "disclosure triangle".
+ *
+ */
+
+#include <config.h>
+#include <gtk/gtk.h>
+
+static GtkWidget *window = NULL;
+
+
+GtkWidget *
+do_expander (GtkWidget *do_widget)
+{
+ GtkWidget *vbox;
+ GtkWidget *label;
+ GtkWidget *expander;
+
+ if (!window)
+ {
+ window = gtk_dialog_new_with_buttons ("GtkExpander",
+ GTK_WINDOW (do_widget),
+ 0,
+ GTK_STOCK_CLOSE,
+ GTK_RESPONSE_NONE,
+ NULL);
+ gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
+
+ g_signal_connect (window, "response",
+ G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (window, "destroy",
+ G_CALLBACK (gtk_widget_destroyed), &window);
+
+ vbox = gtk_vbox_new (FALSE, 5);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
+
+ label = gtk_label_new ("Expander demo. Click on the triangle for details.");
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+ /* Create the expander */
+ expander = gtk_expander_new ("Details");
+ gtk_box_pack_start (GTK_BOX (vbox), expander, FALSE, FALSE, 0);
+
+ label = gtk_label_new ("Details can be shown or hidden.");
+ gtk_container_add (GTK_CONTAINER (expander), label);
+ }
+
+ if (!GTK_WIDGET_VISIBLE (window))
+ gtk_widget_show_all (window);
+ else
+ gtk_widget_destroy (window);
+
+ return window;
+}
+
+