2 * This file is a part of hildon examples
4 * Copyright (C) 2005, 2006, 2007, 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
30 #include <hildon/hildon.h>
33 on_page_switch (GtkNotebook *notebook,
34 GtkNotebookPage *page,
36 HildonWizardDialog *dialog);
39 on_page_switch (GtkNotebook *notebook,
40 GtkNotebookPage *page,
42 HildonWizardDialog *dialog)
44 g_debug ("Page %d", num);
47 /* g_debug ("Making next insensitive! %d", num); */
48 /* gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), HILDON_WIZARD_DIALOG_NEXT, FALSE); */
55 some_page_func (GtkNotebook *nb,
61 /* Validate data only for the third page. */
64 entry = GTK_ENTRY (gtk_notebook_get_nth_page (nb, current));
65 return (strlen (gtk_entry_get_text (entry)) != 0);
72 main (int argc, char **argv)
74 hildon_gtk_init (&argc, &argv);
76 GtkWidget *notebook = gtk_notebook_new ();
77 GtkWidget *label_1 = gtk_label_new ("Page 1");
78 GtkWidget *label_2 = gtk_label_new ("Page 2");
79 GtkWidget *entry_3 = hildon_entry_new (HILDON_SIZE_AUTO);
80 hildon_gtk_entry_set_placeholder_text (GTK_ENTRY (entry_3), " Write something to continue");
81 GtkWidget *label_4 = gtk_label_new ("Page 4");
83 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), label_1, NULL);
84 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), label_2, NULL);
85 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), entry_3, NULL);
86 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), label_4, NULL);
88 GtkWidget *dialog = hildon_wizard_dialog_new (NULL, "Wizard", GTK_NOTEBOOK (notebook));
89 g_signal_connect (G_OBJECT (notebook), "switch-page", G_CALLBACK (on_page_switch), dialog);
90 hildon_wizard_dialog_set_forward_page_func (HILDON_WIZARD_DIALOG (dialog),
91 some_page_func, NULL, NULL);
93 gtk_widget_show_all (dialog);
94 gtk_dialog_run (GTK_DIALOG (dialog));