2 * This file is a part of hildon examples
4 * Copyright (C) 2005, 2009 Nokia Corporation, all rights reserved.
6 * Author: Alejandro Pinheiro <apinheiro@igalia.com>
8 * Based on hildon-banner-example.c
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public License
12 * as published by the Free Software Foundation; version 2.1 of
13 * the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
31 #include <hildon/hildon.h>
35 on_information_clicked (GtkWidget *widget)
37 GtkWidget* banner = NULL;
39 banner = hildon_banner_show_information_override_dnd (widget,
40 "Real important information!!");
42 hildon_banner_set_timeout (HILDON_BANNER (banner), 5000);
51 hildon_gtk_init (&argc, &argv);
53 HildonProgram *program = hildon_program_get_instance ();
55 GtkWidget *window = hildon_window_new ();
57 hildon_gtk_window_set_do_not_disturb (GTK_WINDOW (window), TRUE);
58 hildon_program_add_window (program, HILDON_WINDOW (window));
60 gtk_container_set_border_width (GTK_CONTAINER (window), 6);
62 GtkVBox *vbox = GTK_VBOX (gtk_vbox_new (6, FALSE));
64 GTK_BUTTON (gtk_button_new_with_label ("We are on DND mode\nPress here to show real important information"));
66 g_signal_connect (G_OBJECT (button1), "clicked", G_CALLBACK (on_information_clicked), NULL);
68 g_signal_connect (G_OBJECT (window), "delete_event", G_CALLBACK (gtk_main_quit), NULL);
70 gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (button1), TRUE, TRUE, 0);
72 gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (vbox));
74 gtk_widget_show_all (GTK_WIDGET (window));