Re: text entry validation




hi..thanks for the code...but i think something is missing and it does not
work...here is what i`ve used:

void
on_bt_validate_clicked                 (GtkButton       *button,
                                       gpointer         user_data)  
{

           
           GtkWidget *entry;
        
           gboolean hasdigit = FALSE;
       
           const gchar * string = gtk_entry_get_text (entry);
       
           gint length = strlen (string);
       
           gint i = 0;

       while ((i < length) && (!hasdigit))
       {
               hasdigit = g_ascii_isdigit (string [i]);
               i++;
       }

       if (hasdigit)

           {
                   /* Show dialog */
                   GtkWidget *dialog1;
           dialog1 = create_dialog1 ();
           gtk_widget_show (dialog1);
               
           }      
          
           else
           {
           
                   /* Do something else */
       
           }  


}

there is no error but nothing is displayed and the application is
closed...please help

thanks


-- 
View this message in context: http://www.nabble.com/text-entry-validation-tf3395416.html#a9461256
Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]