2 * xgamelist.c -- Game list window, part of X front end for XBoard
4 * Copyright 1995, 2009, 2010 Free Software Foundation, Inc.
5 * ------------------------------------------------------------------------
7 * GNU XBoard is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or (at
10 * your option) any later version.
12 * GNU XBoard is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see http://www.gnu.org/licenses/. *
20 *------------------------------------------------------------------------
21 ** See the file ChangeLog for a revision history. */
28 #include <sys/types.h>
33 #else /* not STDC_HEADERS */
34 extern char *getenv();
37 # else /* not HAVE_STRING_H */
39 # endif /* not HAVE_STRING_H */
40 #endif /* not STDC_HEADERS */
46 #include <X11/Intrinsic.h>
47 #include <X11/StringDefs.h>
48 #include <X11/Shell.h>
49 #include <X11/cursorfont.h>
51 #include <X11/Xaw3d/Dialog.h>
52 #include <X11/Xaw3d/Form.h>
53 #include <X11/Xaw3d/List.h>
54 #include <X11/Xaw3d/Label.h>
55 #include <X11/Xaw3d/SimpleMenu.h>
56 #include <X11/Xaw3d/SmeBSB.h>
57 #include <X11/Xaw3d/SmeLine.h>
58 #include <X11/Xaw3d/Box.h>
59 #include <X11/Xaw3d/MenuButton.h>
60 #include <X11/Xaw3d/Text.h>
61 #include <X11/Xaw3d/AsciiText.h>
62 #include <X11/Xaw3d/Viewport.h>
64 #include <X11/Xaw/Dialog.h>
65 #include <X11/Xaw/Form.h>
66 #include <X11/Xaw/List.h>
67 #include <X11/Xaw/Label.h>
68 #include <X11/Xaw/SimpleMenu.h>
69 #include <X11/Xaw/SmeBSB.h>
70 #include <X11/Xaw/SmeLine.h>
71 #include <X11/Xaw/Box.h>
72 #include <X11/Xaw/MenuButton.h>
73 #include <X11/Xaw/Text.h>
74 #include <X11/Xaw/AsciiText.h>
75 #include <X11/Xaw/Viewport.h>
82 #include "xgamelist.h"
86 # define _(s) gettext (s)
87 # define N_(s) gettext_noop (s)
94 void SetFocus P((Widget w, XtPointer data, XEvent *event, Boolean *b));
96 extern Widget formWidget, shellWidget, boardWidget, menuBarWidget, gameListShell;
97 extern Display *xDisplay;
98 extern int squareSize;
99 extern Pixmap xMarkPixmap;
100 extern char *layoutName;
102 static Widget filterText;
103 static char filterString[MSG_SIZ];
104 static int listLength;
106 char gameListTranslations[] =
107 "<Btn1Up>(2): LoadSelectedProc(0) \n \
108 <Key>Home: LoadSelectedProc(-2) \n \
109 <Key>End: LoadSelectedProc(2) \n \
110 <Key>Up: LoadSelectedProc(-1) \n \
111 <Key>Down: LoadSelectedProc(1) \n \
112 <Key>Left: LoadSelectedProc(-1) \n \
113 <Key>Right: LoadSelectedProc(1) \n \
114 <Key>Return: LoadSelectedProc(0) \n";
115 char filterTranslations[] =
116 "<Key>Return: SetFilterProc() \n";
127 static GameListClosure *glc = NULL;
129 static Arg layoutArgs[] = {
130 { XtNborderWidth, 0 },
131 { XtNdefaultDistance, 0 }
135 GameListCreate(name, callback, client_data)
137 XtCallbackProc callback;
138 XtPointer client_data;
141 Widget shell, form, viewport, listwidg, layout, label;
142 Widget b_load, b_loadprev, b_loadnext, b_close, b_filter;
145 GameListClosure *glc = (GameListClosure *) client_data;
148 XtSetArg(args[j], XtNwidth, &fw_width); j++;
149 XtGetValues(formWidget, args, j);
152 XtSetArg(args[j], XtNresizable, True); j++;
153 XtSetArg(args[j], XtNallowShellResize, True); j++;
155 shell = gameListShell =
156 XtCreatePopupShell(name, topLevelShellWidgetClass,
157 shellWidget, args, j);
159 shell = gameListShell =
160 XtCreatePopupShell(name, transientShellWidgetClass,
161 shellWidget, args, j);
164 XtCreateManagedWidget(layoutName, formWidgetClass, shell,
165 layoutArgs, XtNumber(layoutArgs));
167 XtSetArg(args[j], XtNborderWidth, 0); j++;
169 XtCreateManagedWidget("form", formWidgetClass, layout, args, j);
172 XtSetArg(args[j], XtNtop, XtChainTop); j++;
173 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
174 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
175 XtSetArg(args[j], XtNright, XtChainRight); j++;
176 XtSetArg(args[j], XtNresizable, False); j++;
177 XtSetArg(args[j], XtNwidth, fw_width); j++;
178 XtSetArg(args[j], XtNallowVert, True); j++;
180 XtCreateManagedWidget("viewport", viewportWidgetClass, form, args, j);
183 XtSetArg(args[j], XtNlist, glc->strings); j++;
184 XtSetArg(args[j], XtNdefaultColumns, 1); j++;
185 XtSetArg(args[j], XtNforceColumns, True); j++;
186 XtSetArg(args[j], XtNverticalList, True); j++;
188 XtCreateManagedWidget("list", listWidgetClass, viewport, args, j);
189 XawListHighlight(listwidg, 0);
190 XtAugmentTranslations(listwidg,
191 XtParseTranslationTable(gameListTranslations));
194 XtSetArg(args[j], XtNfromVert, viewport); j++;
195 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
196 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
197 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
198 XtSetArg(args[j], XtNright, XtChainLeft); j++;
200 XtCreateManagedWidget(_("load"), commandWidgetClass, form, args, j);
201 XtAddCallback(b_load, XtNcallback, callback, client_data);
204 XtSetArg(args[j], XtNfromVert, viewport); j++;
205 XtSetArg(args[j], XtNfromHoriz, b_load); j++;
206 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
207 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
208 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
209 XtSetArg(args[j], XtNright, XtChainLeft); j++;
211 XtCreateManagedWidget(_("prev"), commandWidgetClass, form, args, j);
212 XtAddCallback(b_loadprev, XtNcallback, callback, client_data);
215 XtSetArg(args[j], XtNfromVert, viewport); j++;
216 XtSetArg(args[j], XtNfromHoriz, b_loadprev); j++;
217 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
218 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
219 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
220 XtSetArg(args[j], XtNright, XtChainLeft); j++;
222 XtCreateManagedWidget(_("next"), commandWidgetClass, form, args, j);
223 XtAddCallback(b_loadnext, XtNcallback, callback, client_data);
226 XtSetArg(args[j], XtNfromVert, viewport); j++;
227 XtSetArg(args[j], XtNfromHoriz, b_loadnext); j++;
228 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
229 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
230 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
231 XtSetArg(args[j], XtNright, XtChainLeft); j++;
233 XtCreateManagedWidget(_("close"), commandWidgetClass, form, args, j);
234 XtAddCallback(b_close, XtNcallback, callback, client_data);
237 XtSetArg(args[j], XtNfromVert, viewport); j++;
238 XtSetArg(args[j], XtNfromHoriz, b_close); j++;
239 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
240 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
241 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
242 XtSetArg(args[j], XtNright, XtChainLeft); j++;
243 XtSetArg(args[j], XtNborderWidth, 0); j++;
245 XtCreateManagedWidget(_("Filter:"), labelWidgetClass, form, args, j);
248 XtSetArg(args[j], XtNfromVert, viewport); j++;
249 XtSetArg(args[j], XtNfromHoriz, label); j++;
250 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
251 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
252 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
253 XtSetArg(args[j], XtNright, XtChainRight); j++;
254 XtSetArg(args[j], XtNwidth, fw_width - 225 - squareSize); j++;
255 XtSetArg(args[j], XtNstring, filterString); j++;
256 XtSetArg(args[j], XtNdisplayCaret, False); j++;
257 XtSetArg(args[j], XtNresizable, True); j++;
258 // XtSetArg(args[j], XtNwidth, bw_width); j++; /*force wider than buttons*/
259 /* !!Work around an apparent bug in XFree86 4.0.1 (X11R6.4.3) */
260 XtSetArg(args[j], XtNeditType, XawtextEdit); j++;
261 XtSetArg(args[j], XtNuseStringInPlace, False); j++;
263 XtCreateManagedWidget(_("filtertext"), asciiTextWidgetClass, form, args, j);
264 XtAddEventHandler(filterText, ButtonPressMask, False, SetFocus, (XtPointer) shell);
265 XtOverrideTranslations(filterText,
266 XtParseTranslationTable(filterTranslations));
269 XtSetArg(args[j], XtNfromVert, viewport); j++;
270 XtSetArg(args[j], XtNfromHoriz, filterText); j++;
271 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
272 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
273 XtSetArg(args[j], XtNleft, XtChainRight); j++;
274 XtSetArg(args[j], XtNright, XtChainRight); j++;
276 XtCreateManagedWidget(_("apply"), commandWidgetClass, form, args, j);
277 XtAddCallback(b_filter, XtNcallback, callback, client_data);
280 if(wpGameList.width > 0) {
281 glc->x = wpGameList.x;
282 glc->y = wpGameList.y;
283 glc->w = wpGameList.width;
284 glc->h = wpGameList.height;
294 XtSetArg(args[j], XtNheight, &h1); j++;
295 XtSetArg(args[j], XtNy, &y1); j++;
296 XtGetValues(boardWidget, args, j);
297 glc->w = fw_width * 3/4;
298 glc->h = squareSize * 3;
300 XSync(xDisplay, False);
302 /* This code seems to tickle an X bug if it is executed too soon
303 after xboard starts up. The coordinates get transformed as if
304 the main window was positioned at (0, 0).
306 XtTranslateCoords(shellWidget, (fw_width - glc->w) / 2,
307 y1 + (h1 - glc->h + appData.borderYoffset) / 2,
310 XTranslateCoordinates(xDisplay, XtWindow(shellWidget),
311 RootWindowOfScreen(XtScreen(shellWidget)),
312 (fw_width - glc->w) / 2,
313 y1 + (h1 - glc->h + appData.borderYoffset) / 2,
318 if (glc->y < 0) glc->y = 0; /*avoid positioning top offscreen*/
321 XtSetArg(args[j], XtNheight, glc->h); j++;
322 XtSetArg(args[j], XtNwidth, glc->w); j++;
323 XtSetArg(args[j], XtNx, glc->x - appData.borderXoffset); j++;
324 XtSetArg(args[j], XtNy, glc->y - appData.borderYoffset); j++;
325 XtSetValues(shell, args, j);
327 XtRealizeWidget(shell);
328 CatchDeleteWindow(shell, "GameListPopDown");
329 XtSetKeyboardFocus(shell, listwidg);
336 { // [HGM] filter: put in separate routine, to make callable from call-back
341 nstrings = ((ListGame *) gameList.tailPred)->number;
342 glc->strings = (char **) malloc((nstrings + 1) * sizeof(char *));
344 lg = (ListGame *) gameList.head;
347 line = GameListLine(lg->number, &lg->gameInfo);
348 if(filterString[0] == NULLCHAR || SearchPattern( line, filterString ) ) {
349 *st++ = line; // [HGM] filter: make adding line conditional
352 lg = (ListGame *) lg->node.succ;
361 // filter: put in separate routine, to make callable from call-back
364 listwidg = XtNameToWidget(glc->shell, "*form.viewport.list");
365 XawListChange(listwidg, glc->strings, 0, 0, True);
366 XawListHighlight(listwidg, 0);
370 GameListCallback(w, client_data, call_data)
372 XtPointer client_data, call_data;
378 GameListClosure *glc = (GameListClosure *) client_data;
379 XawListReturnStruct *rs;
383 XtSetArg(args[j], XtNlabel, &name); j++;
384 XtGetValues(w, args, j);
386 if (strcmp(name, _("close")) == 0) {
390 listwidg = XtNameToWidget(glc->shell, "*form.viewport.list");
391 rs = XawListShowCurrent(listwidg);
392 if (strcmp(name, _("load")) == 0) {
393 index = rs->list_index;
395 DisplayError(_("No game selected"), 0);
398 } else if (strcmp(name, _("next")) == 0) {
399 index = rs->list_index + 1;
400 if (index >= listLength) {
401 DisplayError(_("Can't go forward any further"), 0);
404 XawListHighlight(listwidg, index);
405 } else if (strcmp(name, _("prev")) == 0) {
406 index = rs->list_index - 1;
408 DisplayError(_("Can't back up any further"), 0);
411 XawListHighlight(listwidg, index);
412 } else if (strcmp(name, _("apply")) == 0) {
415 XtSetArg(args[j], XtNstring, &name); j++;
416 XtGetValues(filterText, args, j);
417 safeStrCpy(filterString, name, sizeof(filterString)/sizeof(filterString[0]));
418 XawListHighlight(listwidg, 0);
419 if(GameListPrepare()) GameListReplace(); // crashes on empty list...
422 index = atoi(glc->strings[index])-1; // [HGM] filter: read true index from sequence nr of line
423 if (cmailMsgLoaded) {
424 CmailLoadGame(glc->fp, index + 1, glc->filename, True);
426 LoadGame(glc->fp, index + 1, glc->filename, True);
431 GameListPopUp(fp, filename)
440 glc = (GameListClosure *) calloc(1, sizeof(GameListClosure));
441 glc->x = glc->y = -1;
444 if (glc->strings != NULL) {
452 GameListPrepare(); // [HGM] filter: code put in separate routine
456 if (glc->filename != NULL) free(glc->filename);
457 glc->filename = StrSave(filename);
460 if (glc->shell == NULL) {
461 glc->shell = GameListCreate(filename, GameListCallback, glc);
463 GameListReplace(); // [HGM] filter: code put in separate routine
465 XtSetArg(args[j], XtNiconName, (XtArgVal) filename); j++;
466 XtSetArg(args[j], XtNtitle, (XtArgVal) filename); j++;
467 XtSetValues(glc->shell, args, j);
470 XtPopup(glc->shell, XtGrabNone);
473 XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++;
474 XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Game List"),
481 if (glc == NULL) return;
483 if (glc->strings != NULL) {
496 ShowGameListProc(w, event, prms, nprms)
506 DisplayError(_("There is no game list"), 0);
513 XtPopup(glc->shell, XtGrabNone);
516 XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++;
517 XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Game List"),
522 LoadSelectedProc(w, event, prms, nprms)
529 XawListReturnStruct *rs;
530 int index, direction = atoi(prms[0]);
532 if (glc == NULL) return;
533 listwidg = XtNameToWidget(glc->shell, "*form.viewport.list");
534 rs = XawListShowCurrent(listwidg);
535 index = rs->list_index;
536 if (index < 0) return;
539 if(direction == -2) index = 0;
540 if(direction == 2) index = listLength-1;
541 if(index < 0 || index >= listLength) return;
542 XawListHighlight(listwidg, index);
545 index = atoi(glc->strings[index])-1; // [HGM] filter: read true index from sequence nr of line
546 if (cmailMsgLoaded) {
547 CmailLoadGame(glc->fp, index + 1, glc->filename, True);
549 LoadGame(glc->fp, index + 1, glc->filename, True);
554 SetFilterProc(w, event, prms, nprms)
564 XtSetArg(args[j], XtNstring, &name); j++;
565 XtGetValues(filterText, args, j);
566 safeStrCpy(filterString, name, sizeof(filterString)/sizeof(filterString[0]));
567 if(GameListPrepare()) GameListReplace(); // crashes on empty list...
568 list = XtNameToWidget(glc->shell, "*form.viewport.list");
569 XawListHighlight(list, 0);
571 XtSetArg(args[j], XtNdisplayCaret, False); j++;
572 XtSetValues(filterText, args, j);
573 XtSetKeyboardFocus(glc->shell, list);
582 if (glc == NULL) return;
584 XtSetArg(args[j], XtNx, &glc->x); j++;
585 XtSetArg(args[j], XtNy, &glc->y); j++;
586 XtSetArg(args[j], XtNheight, &glc->h); j++;
587 XtSetArg(args[j], XtNwidth, &glc->w); j++;
588 XtGetValues(glc->shell, args, j);
589 wpGameList.x = glc->x - 4;
590 wpGameList.y = glc->y - 23;
591 wpGameList.width = glc->w;
592 wpGameList.height = glc->h;
593 XtPopdown(glc->shell);
594 XtSetKeyboardFocus(shellWidget, formWidget);
597 XtSetArg(args[j], XtNleftBitmap, None); j++;
598 XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Game List"),
603 GameListHighlight(index)
608 if (glc == NULL || !glc->up) return;
609 listwidg = XtNameToWidget(glc->shell, "*form.viewport.list");
611 while(*st && atoi(*st)<index) st++,i++;
612 XawListHighlight(listwidg, i);
618 return glc && glc->up;
621 //--------------------------------- Game-List options dialog ------------------------------------------
623 Widget gameListOptShell, listwidg;
634 void GLT_AddToList(char *name)
636 strings[stringPtr++] = name;
637 strings[stringPtr] = NULL;
640 Boolean GLT_GetFromList(int index, char *name)
642 safeStrCpy(name, strings[index], MSG_SIZ);
646 void GLT_DeSelectList()
648 XawListChange(listwidg, strings, 0, 0, True);
649 XawListHighlight(listwidg, 0);
653 GameListOptionsPopDown()
655 if (gameListOptShell == NULL) return;
657 XtPopdown(gameListOptShell);
658 XtDestroyWidget(gameListOptShell);
659 gameListOptShell = 0;
660 XtSetKeyboardFocus(shellWidget, formWidget);
664 GameListOptionsCallback(w, client_data, call_data)
666 XtPointer client_data, call_data;
672 XawListReturnStruct *rs;
677 XtSetArg(args[j], XtNlabel, &name); j++;
678 XtGetValues(w, args, j);
680 if (strcmp(name, _("OK")) == 0) {
682 appData.gameListTags = strdup(lpUserGLT);
683 GameListOptionsPopDown();
686 if (strcmp(name, _("cancel")) == 0) {
687 GameListOptionsPopDown();
690 listwidg = XtNameToWidget(gameListOptShell, "*form.list");
691 rs = XawListShowCurrent(listwidg);
692 index = rs->list_index;
694 DisplayError(_("No tag selected"), 0);
698 if (strcmp(name, _("down")) == 0) {
699 if(index >= strlen(GLT_ALL_TAGS)) return;
700 strings[index] = strings[index+1];
701 strings[++index] = p;
703 if (strcmp(name, _("up")) == 0) {
704 if(index == 0) return;
705 strings[index] = strings[index-1];
706 strings[--index] = p;
708 if (strcmp(name, _("factory")) == 0) {
709 safeStrCpy(lpUserGLT, GLT_DEFAULT_TAGS, LPUSERGLT_SIZE);
710 GLT_TagsToList(lpUserGLT);
713 XawListHighlight(listwidg, index);
717 GameListOptionsCreate()
720 Widget shell, form, viewport, layout;
721 Widget b_load, b_loadprev, b_loadnext, b_close, b_cancel;
723 XtPointer client_data = NULL;
727 XtSetArg(args[j], XtNwidth, &fw_width); j++;
728 XtGetValues(formWidget, args, j);
731 XtSetArg(args[j], XtNresizable, True); j++;
732 XtSetArg(args[j], XtNallowShellResize, True); j++;
733 shell = gameListOptShell =
734 XtCreatePopupShell("Game-list options", transientShellWidgetClass,
735 shellWidget, args, j);
737 XtCreateManagedWidget(layoutName, formWidgetClass, shell,
738 layoutArgs, XtNumber(layoutArgs));
740 XtSetArg(args[j], XtNborderWidth, 0); j++;
742 XtCreateManagedWidget("form", formWidgetClass, layout, args, j);
745 XtSetArg(args[j], XtNdefaultColumns, 1); j++;
746 XtSetArg(args[j], XtNforceColumns, True); j++;
747 XtSetArg(args[j], XtNverticalList, True); j++;
748 listwidg = viewport =
749 XtCreateManagedWidget("list", listWidgetClass, form, args, j);
750 XawListHighlight(listwidg, 0);
751 // XtAugmentTranslations(listwidg,
752 // XtParseTranslationTable(gameListOptTranslations));
755 XtSetArg(args[j], XtNfromVert, viewport); j++;
756 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
757 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
758 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
759 XtSetArg(args[j], XtNright, XtChainLeft); j++;
761 XtCreateManagedWidget(_("factory"), commandWidgetClass, form, args, j);
762 XtAddCallback(b_load, XtNcallback, GameListOptionsCallback, client_data);
765 XtSetArg(args[j], XtNfromVert, viewport); j++;
766 XtSetArg(args[j], XtNfromHoriz, b_load); j++;
767 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
768 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
769 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
770 XtSetArg(args[j], XtNright, XtChainLeft); j++;
772 XtCreateManagedWidget(_("up"), commandWidgetClass, form, args, j);
773 XtAddCallback(b_loadprev, XtNcallback, GameListOptionsCallback, client_data);
776 XtSetArg(args[j], XtNfromVert, viewport); j++;
777 XtSetArg(args[j], XtNfromHoriz, b_loadprev); j++;
778 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
779 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
780 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
781 XtSetArg(args[j], XtNright, XtChainLeft); j++;
783 XtCreateManagedWidget(_("down"), commandWidgetClass, form, args, j);
784 XtAddCallback(b_loadnext, XtNcallback, GameListOptionsCallback, client_data);
787 XtSetArg(args[j], XtNfromVert, viewport); j++;
788 XtSetArg(args[j], XtNfromHoriz, b_loadnext); j++;
789 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
790 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
791 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
792 XtSetArg(args[j], XtNright, XtChainLeft); j++;
794 XtCreateManagedWidget(_("cancel"), commandWidgetClass, form, args, j);
795 XtAddCallback(b_cancel, XtNcallback, GameListOptionsCallback, client_data);
798 XtSetArg(args[j], XtNfromVert, viewport); j++;
799 XtSetArg(args[j], XtNfromHoriz, b_cancel); j++;
800 XtSetArg(args[j], XtNtop, XtChainBottom); j++;
801 XtSetArg(args[j], XtNbottom, XtChainBottom); j++;
802 XtSetArg(args[j], XtNleft, XtChainLeft); j++;
803 XtSetArg(args[j], XtNright, XtChainLeft); j++;
805 XtCreateManagedWidget(_("OK"), commandWidgetClass, form, args, j);
806 XtAddCallback(b_close, XtNcallback, GameListOptionsCallback, client_data);
808 safeStrCpy(lpUserGLT, appData.gameListTags, LPUSERGLT_SIZE);
809 GLT_TagsToList(lpUserGLT);
811 XtRealizeWidget(shell);
812 CatchDeleteWindow(shell, "GameListOptionsPopDown");
818 GameListOptionsPopUp(Widget w, XEvent *event, String *prms, Cardinal *nprms)
820 if (gameListOptShell == NULL)
821 gameListOptShell = GameListOptionsCreate();
823 XtPopup(gameListOptShell, XtGrabNone);