From: H.G. Muller Date: Wed, 21 Mar 2012 22:12:20 +0000 (+0100) Subject: Fix focus of Game List X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=464c6c9802bdf2b1637a343467a6c85280b5e721;p=xboard.git Fix focus of Game List After focus was transferred to the filter text-edit, it was impossible to get it back on the game list (to make the arrow keys working again). A translation to left down-click is now used to assign focus, just as it would for text edits. For unknown reason this only worked if the translations were instated by Overriding, rather than Augmenting, which again required the normal translation of downclick, Set(), which selects the clicked item, to be explicitly mentioned as well. --- diff --git a/xgamelist.c b/xgamelist.c index a0f964b..47cf77e 100644 --- a/xgamelist.c +++ b/xgamelist.c @@ -98,7 +98,8 @@ static char filterString[MSG_SIZ]; static int listLength, wins, losses, draws, page; char gameListTranslations[] = - "(2): LoadSelectedProc(0) \n \ + ": LoadSelectedProc(100) Set() \n \ + (2): LoadSelectedProc(0) \n \ Home: LoadSelectedProc(-2) \n \ End: LoadSelectedProc(2) \n \ CtrlUp: LoadSelectedProc(-3) \n \ @@ -177,7 +178,7 @@ GameListCreate (char *name, XtCallbackProc callback, XtPointer client_data) listwidg = XtCreateManagedWidget("list", listWidgetClass, viewport, args, j); XawListHighlight(listwidg, 0); - XtAugmentTranslations(listwidg, + XtOverrideTranslations(listwidg, XtParseTranslationTable(gameListTranslations)); j = 0; @@ -548,9 +549,10 @@ LoadSelectedProc (Widget w, XEvent *event, String *prms, Cardinal *nprms) Widget listwidg; XawListReturnStruct *rs; int index, direction = atoi(prms[0]); - +printf("action(%d)\n",direction); if (glc == NULL || listLength == 0) return; listwidg = XtNameToWidget(glc->shell, "*form.viewport.list"); + if(direction == 100) { XtSetKeyboardFocus(glc->shell, listwidg); return; } rs = XawListShowCurrent(listwidg); index = rs->list_index; if (index < 0) return;