Re: tab order



    Jeff> I set it all up, but I'm realizing that I still don't have a way to
    Jeff> grab it when the tab key has caused the widget to lose its focus and
    Jeff> not any other time. I tried using a generic GdkEvent and casting it
    Jeff> to GdkEventKey and grabbing the keyval, but it didn't work. Is there
    Jeff> a way to test for that?

I'm not where I can try this at the moment, but the scenario might go
something like this (corrections welcome):

typedef struct {
  GtkWidget **list;
  gint current;
  gint next;
  gint prev;
} TraverseList;

int
handle_focus_in(GtkWidget *widget, GdkEventFocus *event)
{
  TraverseList *tlist;

  tlist = (TraverseList *) gtk_object_get_data(GTK_OBJECT(widget),
                                               "traversal_list");

  if (widget != tlist->list[tlist->next]) {
    event->window = tlist->list[tlist->next]->window;
    /* call whatever the GTK equivalent of XSendEvent() is here. */
    return TRUE;
  }
  tlist->current++;
  tlist->next++;
  tlist->prev++;
  return FALSE;
}
-----------------------------------------------------------------------------
Mark Leisher
Computing Research Lab            Cinema, radio, television, magazines are a
New Mexico State University       school of inattention: people look without
Box 30001, Dept. 3CRL             seeing, listen without hearing.
Las Cruces, NM  88003                            -- Robert Bresson




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