How to move to next GTK_ENTRY



I've got a chain of gtk_entrys that I want to advance between when I hit
tab.  I've almost got it working, but all the following does is select
text ... it does not allow me to edit.  I have to manually click the
mouse.

?

void cb_move_next (GtkWidget *text, GdkEventKey *event, signal_object
*s_obj)
{
 GtkWidget *next_ent;
 signal_object *next_obj;
 char* next_text;
 printf("cb_move_next()\n");

 if (event->keyval == GDK_Tab) {
  if (s_obj->next) {
   next_obj = s_obj->next;
   next_ent = next_obj->data->text_ent;
   next_text = gtk_entry_get_text(GTK_ENTRY(next_ent));
   gtk_widget_activate(next_ent);

gtk_editable_select_region(GTK_EDITABLE(next_ent),0,strlen(next_text));
   gtk_editable_set_position(GTK_EDITABLE(next_ent),0);
  }
 }
}

Thanks,

DT
--
Technical Director - Virginia Center for Computer Music
http://www.virginia.edu/music/vccm.html






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