int main (int argc, char **argv) { hildon_gtk_init (&argc, &argv); GtkDialog *dialog = GTK_DIALOG (hildon_get_password_dialog_new (NULL, TRUE)); hildon_get_password_dialog_set_message ((HildonGetPasswordDialog *) dialog, "Enter secret password"); gtk_widget_show_all (GTK_WIDGET (dialog)); gtk_dialog_run (dialog); g_debug ("Password: %s", hildon_get_password_dialog_get_password ((HildonGetPasswordDialog *) dialog)); return 0; }
static void fx_setup_default_get_password_dialog () { int argc = 0; gtk_init(&argc, NULL); gpd_window = GTK_WINDOW(create_test_window()); /* Check the auxiliary window is being created properly */ fail_if (!GTK_IS_WINDOW (gpd_window), "hildon-get-password-dialog: Window creation failed."); get_password_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(gpd_window, TRUE)); /* Check get password dialog object has been created properly */ fail_if(!HILDON_IS_GET_PASSWORD_DIALOG (get_password_dialog), "hildon-get-password-dialog: Creation failed."); show_test_window(GTK_WIDGET(gpd_window)); show_test_window(GTK_WIDGET(get_password_dialog)); }