2 * This file is a part of hildon examples
4 * Copyright (C) 2005, 2008 Nokia Corporation, all rights reserved.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; version 2.1 of
10 * the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 #include <hildon/hildon.h>
28 on_picker_value_changed (HildonPickerButton * button, gpointer data)
30 g_print ("Newly selected value: %s\n",
31 hildon_button_get_value (HILDON_BUTTON (button)));
35 main (int argc, char **argv)
37 HildonProgram *program = NULL;
38 GtkWidget *window = NULL;
41 hildon_gtk_init (&argc, &argv);
43 program = hildon_program_get_instance ();
44 g_set_application_name ("hildon-date-button-example");
46 window = hildon_stackable_window_new ();
47 gtk_window_set_default_size (GTK_WINDOW (window), 300, 200);
48 hildon_program_add_window (program, HILDON_WINDOW (window));
50 button = hildon_date_button_new_with_year_range (HILDON_SIZE_AUTO,
51 HILDON_BUTTON_ARRANGEMENT_VERTICAL,
53 g_signal_connect (G_OBJECT (button), "value-changed",
54 G_CALLBACK (on_picker_value_changed), NULL);
56 gtk_container_add (GTK_CONTAINER (window), button);
58 g_signal_connect (G_OBJECT (window), "delete-event",
59 G_CALLBACK (gtk_main_quit), NULL);
61 gtk_widget_show_all (window);