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);
55 #ifndef HILDON_DISABLE_DEPRECATED
58 on_animation_clicked (GtkWidget *widget)
60 GtkWidget *banner = hildon_banner_show_animation (widget, NULL, "Animation banner");
61 g_object_ref (banner);
62 gdk_threads_add_timeout (5000, (GSourceFunc) on_animation_idle, banner);
67 on_progress_clicked (GtkWidget *widget)
69 GtkWidget *banner = hildon_banner_show_progress (widget, NULL, "Progress banner");
70 g_object_ref (banner);
71 gdk_threads_add_timeout (5000, (GSourceFunc) on_progress_idle, banner);
81 HildonProgram *program;
82 GtkWidget *window, *vbox, *button1;
83 #ifndef HILDON_DISABLE_DEPRECATED
84 GtkWidget *button2, *button3;
87 hildon_gtk_init (&argc, &argv);
89 window = hildon_window_new ();
90 program = hildon_program_get_instance ();
91 hildon_program_add_window (program, HILDON_WINDOW (window));
93 button1 = gtk_button_new_with_label ("Information");
94 g_signal_connect (button1, "clicked", G_CALLBACK (on_information_clicked), NULL);
96 #ifndef HILDON_DISABLE_DEPRECATED
97 button2 = gtk_button_new_with_label ("Animation");
98 g_signal_connect (button2, "clicked", G_CALLBACK (on_animation_clicked), NULL);
100 button3 = gtk_button_new_with_label ("Progress");
101 g_signal_connect (button3, "clicked", G_CALLBACK (on_progress_clicked), NULL);
104 vbox = gtk_vbox_new (6, FALSE);
105 gtk_box_pack_start (GTK_BOX (vbox), button1, TRUE, TRUE, 0);
106 #ifndef HILDON_DISABLE_DEPRECATED
107 gtk_box_pack_start (GTK_BOX (vbox), button2, TRUE, TRUE, 0);
108 gtk_box_pack_start (GTK_BOX (vbox), button3, TRUE, TRUE, 0);
111 gtk_container_set_border_width (GTK_CONTAINER (window), 6);
112 gtk_container_add (GTK_CONTAINER (window), vbox);
114 gtk_widget_show_all (window);
116 g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);