X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=examples%2Fhildon-date-editor-example.c;h=0685bfe3125a882abadcba7df56fe44a9c733b4f;hb=a6a438fefa4f44520b42921abe02f3c78df1b2e7;hp=44731b102f940c3a84beaf6c717b7ca907e12540;hpb=f905c29467fcce6ded7e87e0e6e9b46ca2aa46f9;p=hildon diff --git a/examples/hildon-date-editor-example.c b/examples/hildon-date-editor-example.c index 44731b1..0685bfe 100644 --- a/examples/hildon-date-editor-example.c +++ b/examples/hildon-date-editor-example.c @@ -26,7 +26,7 @@ #include #include #include -#include "hildon.h" +#include static gboolean on_error (GtkWidget *widget, HildonDateTimeError error_type); @@ -39,20 +39,27 @@ on_error (GtkWidget *widget, HildonDateTimeError error_type) } int -main (int argc, char **args) +main (int argc, char **argv) { - gtk_init (&argc, &args); - + guint y, m, d; + + hildon_gtk_init (&argc, &argv); + GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ()); HildonDateEditor *date_editor = HILDON_DATE_EDITOR (hildon_date_editor_new ()); - gtk_box_pack_start (GTK_BOX (dialog->vbox), GTK_WIDGET (date_editor), FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (dialog->vbox), gtk_label_new ("Choose a date"), FALSE, FALSE, 10); + gtk_box_pack_start (GTK_BOX (dialog->vbox), GTK_WIDGET (date_editor), FALSE, FALSE, 10); gtk_dialog_add_button (dialog, "Close", GTK_RESPONSE_CANCEL); g_signal_connect (G_OBJECT (date_editor), "date_error", G_CALLBACK (on_error), NULL); gtk_widget_show_all (GTK_WIDGET (dialog)); gtk_dialog_run (dialog); + + hildon_date_editor_get_date (date_editor, &y, &m, &d); + + g_debug ("Date: %u-%u-%u", y, m, d); return 0; }