[Glade-users] about dialog box




I am using Glade-2 and C code. I am doing input validation after leaving an entry field. I put the validation 
inside _focus_out_event handler. Now, upon leaving the field, if it fails validation, I want to display a 
dialog box. So inside _focus_out_event handler I do the following:
 
text = lookup_widget(widget, "myField");
if (input_invalid(text)) {
  dialog1 = create_dialog1();
  gtk_dialog_run (GTK_DIALOG(dialog1));
  gtk_widget_hide(dialog1);
  gtk_widget_grab_focus(text);
}
return FALSE;
 
but it gives me the following errors at run time:
Gtk-WARNING **: GtkEntry - did not receive focus-out-event. If you connect a handler to this signal, it must 
return FALSE so the entry gets the event as well.
Gtk-ERROR **: file gtkentry.c: line 5287 (blink_cb): assertion failed: (GTK_WIDGET_HAS_FOCUS(entry)).
 
Any idea what I am doing wrong and how to fix it?
 
Thanks much.
Arthur.                                           
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20100907/29ee9e50/attachment.html 




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