[Glade-users] envoking 'clicked' signal




I am using Glade-2 and generated C code.
I have a window with few entry fields and a Next btn which when clicked on generates 'clicked' signal and in 
the _clicked handler I am checking validity of the entries and proceed. What I want to do is in the last 
entry field, when I click Enter, it should imitate the click on the Next button (to check validity of all the 
entry fields). For clicking Enter, I have _activate handler that catches the Enter key event. It seems that 
right in this _activate handler I can call the _clicked handler for the Next button, as simple as that -- 
just call the same function (handler) that is called when Next button is clicked. This works, but I just want 
to make sure that calling handlers from other handlers like that is allowed. Is it?
Here is my simplified example:
 
on_btnNext_clicked (GtkButton *button, gpointer user_data) {
   /** this is Next button clicked handler **/
   /** I do validation of entry fields here **/
}
 
on_entryField1_activate(GtkEntry *entry, gpointer user_data) {
 
   /** this is _activate handler for a field where I am caching Enter key **/
 
   GtkWidget *button;
 
   button = lookup_widget(GTK_WIDGET(entry), "btnNext");
   on_btnNext_clicked(GTK_BUTTON(button), user_data);  /** CAN I CALL THIS HANDLER JUST LIKE THAT ????? **/
}
 
Thanks,
Arthur.                                           
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20100916/0c4531fa/attachment-0001.html 




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