2 * This file is a part of hildon examples
4 * Copyright (C) 2005, 2006, 2009 Nokia Corporation, all rights reserved.
6 * Author: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; version 2.1 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 #include <hildon/hildon.h>
27 #ifndef HILDON_DISABLE_DEPRECATED
30 on_animation_idle (GtkWidget *banner)
32 gtk_widget_destroy (banner);
33 g_object_unref (banner);
38 on_progress_idle (GtkWidget *banner)
40 gtk_widget_destroy (banner);
41 g_object_unref (banner);
48 on_information_clicked (GtkWidget *widget)
50 GtkWidget* banner = hildon_banner_show_information (widget, NULL, "Information banner");
51 hildon_banner_set_timeout (HILDON_BANNER (banner), 9000);
54 #ifndef HILDON_DISABLE_DEPRECATED
57 on_animation_clicked (GtkWidget *widget)
59 GtkWidget *banner = hildon_banner_show_animation (widget, NULL, "Animation banner");
60 g_object_ref (banner);
61 gdk_threads_add_timeout (5000, (GSourceFunc) on_animation_idle, banner);
65 on_progress_clicked (GtkWidget *widget)
67 GtkWidget *banner = hildon_banner_show_progress (widget, NULL, "Progress banner");
68 g_object_ref (banner);
69 gdk_threads_add_timeout (5000, (GSourceFunc) on_progress_idle, banner);
78 HildonProgram *program;
79 GtkWidget *window, *vbox, *button1;
80 #ifndef HILDON_DISABLE_DEPRECATED
81 GtkWidget *button2, *button3;
84 hildon_gtk_init (&argc, &argv);
86 window = hildon_window_new ();
87 program = hildon_program_get_instance ();
88 hildon_program_add_window (program, HILDON_WINDOW (window));
90 button1 = gtk_button_new_with_label ("Information");
91 g_signal_connect (button1, "clicked", G_CALLBACK (on_information_clicked), NULL);
93 #ifndef HILDON_DISABLE_DEPRECATED
94 button2 = gtk_button_new_with_label ("Animation");
95 g_signal_connect (button2, "clicked", G_CALLBACK (on_animation_clicked), NULL);
97 button3 = gtk_button_new_with_label ("Progress");
98 g_signal_connect (button3, "clicked", G_CALLBACK (on_progress_clicked), NULL);
101 vbox = gtk_vbox_new (6, FALSE);
102 gtk_box_pack_start (GTK_BOX (vbox), button1, TRUE, TRUE, 0);
103 #ifndef HILDON_DISABLE_DEPRECATED
104 gtk_box_pack_start (GTK_BOX (vbox), button2, TRUE, TRUE, 0);
105 gtk_box_pack_start (GTK_BOX (vbox), button3, TRUE, TRUE, 0);
108 gtk_container_set_border_width (GTK_CONTAINER (window), 6);
109 gtk_container_add (GTK_CONTAINER (window), vbox);
111 gtk_widget_show_all (window);
113 g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);