[maemo-developers] C - GTK - Dialog Box - I never get the result
From: David Hautbois david.hautbois at free.frDate: Tue Jan 29 17:20:17 EET 2008
- Previous message: Change ESSID of WLAN0 via ioctl
- Next message: C - GTK - Dialog Box - I never get the result
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi I'm playing with C and GTK. I have a problem to get the result of a dialogbox. The code : **************************************************************** GtkWidget* pBoite; GtkWidget* pEntry; pBoite = gtk_dialog_new_with_buttons("Saisie du nom", GTK_WINDOW(main_window), GTK_DIALOG_MODAL, GTK_STOCK_OK,GTK_RESPONSE_OK, GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL, NULL); pEntry = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(pEntry), "Enter your name"); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(pBoite)->vbox), pEntry, TRUE, FALSE, 0); gtk_widget_show_all(GTK_DIALOG(pBoite)->vbox); switch (gtk_dialog_run(GTK_DIALOG(pBoite))) { case GTK_RESPONSE_OK: printf("ok"); break; case GTK_RESPONSE_CANCEL: printf("cancel"); case GTK_RESPONSE_NONE: default: printf("none"); break; } gtk_widget_destroy(pBoite); ******************************************************************** It's very simple. But, when I validate the dialogbox, I never get GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, GTK_RESPONSE_NONE. At the beginning, I used Glade, and had the same problem. I don't have tested it on my pc yet.... Any idea ? Thanks. David. -- Web site : http://david.hautbois.free.fr Tablet users map : http://david.hautbois.free.fr/maps/index.php
- Previous message: Change ESSID of WLAN0 via ioctl
- Next message: C - GTK - Dialog Box - I never get the result
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]