2008-12-10 Thomas Thurman <thomas.thurman@collabora.co.uk>
authorThomas Thurman <thomas.thurman@collabora.co.uk>
Wed, 10 Dec 2008 21:54:49 +0000 (21:54 +0000)
committerThomas Thurman <thomas.thurman@collabora.co.uk>
Wed, 10 Dec 2008 21:54:49 +0000 (21:54 +0000)
* examples/hildon-progress-indicator-example.c: new file
        * examples/Makefile.am: include the new example program

ChangeLog
examples/Makefile.am
examples/hildon-progress-indicator-example.c [new file with mode: 0644]

index 913da91..c22a4ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-10  Thomas Thurman  <thomas.thurman@collabora.co.uk>
+
+        * examples/hildon-progress-indicator-example.c: new file
+        * examples/Makefile.am: include the new example program
+
 2008-12-10  Alberto Garcia  <agarcia@igalia.com>
 
        * src/hildon-wizard-dialog.c (destroy): Fix compilation warning
 
        Fixes: NB#93890 (Empty HildonAppMenu is pop-up)
 
+>>>>>>> .r33194
 2008-11-27  Claudio Saavedra  <csaavedra@igalia.com>
 
        * src/hildon-picker-dialog.c:
index 7f18aee..48afc54 100644 (file)
@@ -34,7 +34,8 @@ EXAMPLES                              = hildon-window-example                         \
                                          hildon-check-button-example                   \
                                          hildon-touch-selector-example                 \
                                          hildon-touch-selector-multi-cells-example     \
-                                         hildon-touch-selector-entry-example
+                                         hildon-touch-selector-entry-example           \
+                                         hildon-progress-indicator-example
 if USE_MAEMO_GTK
 MAEMO_GTK_EXAMPLES                      = hildon-pannable-area-touch-list-example      \
                                          hildon-pannable-area-touch-grid-example
@@ -434,6 +435,12 @@ hildon_touch_selector_entry_example_CFLAGS = $(HILDON_OBJ_CFLAGS)                  \
                                                  $(EXTRA_CFLAGS)
 hildon_touch_selector_entry_example_SOURCES    = hildon-touch-selector-entry-example.c
 
+# Hildon progress indicator
+hildon_progress_indicator_example_LDADD                = $(HILDON_OBJ_LIBS)
+hildon_progress_indicator_example_CFLAGS       = $(HILDON_OBJ_CFLAGS)                  \
+                                                 $(EXTRA_CFLAGS)
+hildon_progress_indicator_example_SOURCES      = hildon-progress-indicator-example.c
+
 endif
 
 examplesdir                             = $(datadir)/doc/libhildon1-examples/examples
@@ -497,4 +504,5 @@ examples_DATA                               = Makefile.static                               \
                                          hildon-check-button-example.c                 \
                                          hildon-touch-selector-example.c               \
                                          hildon-touch-selector-multi-cells-example.c   \
-                                         hildon-touch-selector-entry-example.c
+                                         hildon-touch-selector-entry-example.c         \
+                                          hildon-progress-indicator-example.c
diff --git a/examples/hildon-progress-indicator-example.c b/examples/hildon-progress-indicator-example.c
new file mode 100644 (file)
index 0000000..8cd7eaf
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * This file is a part of hildon examples
+ *
+ * Copyright (C) 2008 Nokia Corporation, all rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include                                        "hildon.h"
+
+HildonTextView *textview;
+GtkTextBuffer *buffer;
+
+static void
+show_progress_button_clicked                    (GtkWindow   *window,
+                                                 HildonEntry *entry)
+{
+    g_debug ("Showing progress indicator...");
+    hildon_gtk_window_set_progress_indicator (window, 1);
+}
+
+static void
+hide_progress_button_clicked                    (GtkWindow   *window,
+                                                 HildonEntry *entry)
+{
+    g_debug ("Hiding progress indicator...");
+    hildon_gtk_window_set_progress_indicator (window, 0);
+}
+
+int
+main                                            (int    argc,
+                                                 char **argv)
+{
+    GtkWidget *win;
+    GtkWidget *showprogressbutton, *hideprogressbutton;
+    GtkBox *vbox;
+
+    hildon_gtk_init (&argc, &argv);
+
+    /* Window and vbox to pack everything */
+    win = hildon_stackable_window_new ();
+    vbox = GTK_BOX (gtk_vbox_new (FALSE, 10));
+
+    /* Buttons */
+    showprogressbutton = hildon_gtk_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
+    gtk_button_set_label (GTK_BUTTON (showprogressbutton), "Show progress indicator");
+
+    hideprogressbutton = hildon_gtk_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
+    gtk_button_set_label (GTK_BUTTON (hideprogressbutton), "Hide progress indicator");
+
+    /* Pack all widgets */
+    gtk_box_pack_start (GTK_BOX (vbox), showprogressbutton, TRUE, TRUE, 0);
+    gtk_box_pack_start (GTK_BOX (vbox), hideprogressbutton, TRUE, TRUE, 0);
+
+    gtk_container_set_border_width (GTK_CONTAINER (win), 20);
+    gtk_container_add (GTK_CONTAINER (win), GTK_WIDGET (vbox));
+
+    /* Connect signals */
+    g_signal_connect (win, "destroy", G_CALLBACK (gtk_main_quit), NULL);
+    g_signal_connect (showprogressbutton, "clicked",
+                      G_CALLBACK (show_progress_button_clicked), win);
+    g_signal_connect (hideprogressbutton, "clicked",
+                      G_CALLBACK (hide_progress_button_clicked), win);
+
+    /* Run example */
+    gtk_widget_show_all (win);
+    gtk_main ();
+
+    return 0;
+}