2 * This file is a part of hildon examples
4 * Copyright (C) 2008 Nokia Corporation, all rights reserved.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; version 2.1 of
9 * the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 #include <hildon/hildon.h>
25 HildonTextView *textview;
26 GtkTextBuffer *buffer;
29 show_progress_button_clicked (GtkWidget *button,
32 g_debug ("Showing progress indicator...");
33 hildon_gtk_window_set_progress_indicator (window, 1);
37 hide_progress_button_clicked (GtkWidget *button,
40 g_debug ("Hiding progress indicator...");
41 hildon_gtk_window_set_progress_indicator (window, 0);
49 GtkWidget *showprogressbutton, *hideprogressbutton;
52 hildon_gtk_init (&argc, &argv);
54 /* Window and vbox to pack everything */
55 win = hildon_stackable_window_new ();
56 vbox = GTK_BOX (gtk_vbox_new (FALSE, 10));
59 showprogressbutton = hildon_gtk_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
60 gtk_button_set_label (GTK_BUTTON (showprogressbutton), "Show progress indicator");
62 hideprogressbutton = hildon_gtk_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
63 gtk_button_set_label (GTK_BUTTON (hideprogressbutton), "Hide progress indicator");
65 /* Pack all widgets */
66 gtk_box_pack_start (GTK_BOX (vbox), showprogressbutton, TRUE, TRUE, 0);
67 gtk_box_pack_start (GTK_BOX (vbox), hideprogressbutton, TRUE, TRUE, 0);
69 gtk_container_set_border_width (GTK_CONTAINER (win), 20);
70 gtk_container_add (GTK_CONTAINER (win), GTK_WIDGET (vbox));
73 g_signal_connect (win, "destroy", G_CALLBACK (gtk_main_quit), NULL);
74 g_signal_connect (showprogressbutton, "clicked",
75 G_CALLBACK (show_progress_button_clicked), win);
76 g_signal_connect (hideprogressbutton, "clicked",
77 G_CALLBACK (hide_progress_button_clicked), win);
80 gtk_widget_show_all (win);