[Glade-users] when done editing field




OK, this is what I figured out and it seems to work:
in my handler that is invoked when I press Enter key, I have the following:
on_myField_activate (GtkEntry *entry, gpointer user_data) {
   GtkWidget *win, *next_field;
 
   win = gtk_widget_get_toplevel(GTK_WIDGET(entry));
   next_field = lookup_widget(win, "myNextField");
   gtk_widget_grab_focus(next_field);
}
This puts the cursor and focus to the field I specified. Is it the right way to do this kind of thing?
 
Thanks much,
Arthur.
 


From: ashats at hotmail.com
To: glade-users at lists.ximian.com
Date: Wed, 15 Sep 2010 18:13:16 +0000
Subject: Re: [Glade-users] when done editing field




OK, I figured out that Glade has _activated handler which comes into play when I hit 'enter' in the field. I 
suppose I would need to call gtk_widget_grab_focus(myField) here to set the focus to some field: 'myField'. 
The question is, how do I get the pointer to myField? In this handler I only have access to the current 
field. 
Thanks,
Arthur. 


From: ashats at hotmail.com
To: glade-users at lists.ximian.com
Date: Wed, 15 Sep 2010 16:44:54 +0000
Subject: [Glade-users] when done editing field



I am using Glade-2 and generated C code. On my window I have a few entry fields and after I type in a field 
and press enter, I'd like the cursor to jump to the next field. How can I do it and what handler I need to 
add in Glade-2 ?
Thanks,
Arthur.

_______________________________________________ Glade-users maillist - Glade-users at lists.ximian.com 
http://lists.ximian.com/mailman/listinfo/glade-users 
_______________________________________________ Glade-users maillist - Glade-users at lists.ximian.com 
http://lists.ximian.com/mailman/listinfo/glade-users                                       
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20100915/5437203a/attachment.html 




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