X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=7c8928da0f8de8d859c768630ef8b20140fe3703;hb=b6a78e6a5c3d571973b43996efc4386d0b55742f;hp=035866c2f50f1bef9b40f4f96c8b8d6a7d8bb20a;hpb=8e8f7200a0db9c816e5b508bc0cd377a393bda41;p=xboard.git diff --git a/xboard.c b/xboard.c index 035866c..7c8928d 100644 --- a/xboard.c +++ b/xboard.c @@ -293,7 +293,6 @@ GC lightSquareGC, darkSquareGC, lineGC, wdPieceGC, wlPieceGC, Pixmap iconPixmap, wIconPixmap, bIconPixmap, xMarkPixmap; Widget shellWidget, formWidget, boardWidget, titleWidget, dropMenu, menuBarWidget; Option *optList; // contains all widgets of main window -XSegment secondSegments[BOARD_RANKS + BOARD_FILES + 2]; XSegment gridSegments[BOARD_RANKS + BOARD_FILES + 2]; #if ENABLE_NLS XFontSet fontSet, clockFontSet; @@ -432,60 +431,60 @@ XtActionsRec boardActions[] = { }; char globalTranslations[] = - ":F9: MenuItem(ResignProc) \n \ - :Ctrln: MenuItem(NewGame) \n \ - :MetaV: MenuItem(NewVariant) \n \ - :Ctrlo: MenuItem(LoadGame) \n \ + ":F9: MenuItem(Actions.Resign) \n \ + :Ctrln: MenuItem(File.NewGame) \n \ + :MetaV: MenuItem(File.NewVariant) \n \ + :Ctrlo: MenuItem(File.LoadGame) \n \ :MetaNext: MenuItem(LoadNextGameProc) \n \ :MetaPrior: MenuItem(LoadPrevGameProc) \n \ :CtrlDown: LoadSelectedProc(3) \n \ :CtrlUp: LoadSelectedProc(-3) \n \ - :Ctrls: MenuItem(SaveGame) \n \ - :Ctrlc: MenuItem(CopyGame) \n \ - :Ctrlv: MenuItem(PasteGame) \n \ - :CtrlO: MenuItem(LoadPosition) \n \ + :Ctrls: MenuItem(File.SaveGame) \n \ + :Ctrlc: MenuItem(Edit.CopyGame) \n \ + :Ctrlv: MenuItem(Edit.PasteGame) \n \ + :CtrlO: MenuItem(File.LoadPosition) \n \ :ShiftNext: MenuItem(LoadNextPositionProc) \n \ :ShiftPrior: MenuItem(LoadPrevPositionProc) \n \ - :CtrlS: MenuItem(SavePosition) \n \ - :CtrlC: MenuItem(CopyPosition) \n \ - :CtrlV: MenuItem(PastePosition) \n \ - :Ctrlq: MenuItem(Exit) \n \ - :Ctrlw: MenuItem(MachineWhite) \n \ - :Ctrlb: MenuItem(MachineBlack) \n \ - :Ctrlt: MenuItem(TwoMachines) \n \ - :Ctrla: MenuItem(AnalysisMode) \n \ - :Ctrlg: MenuItem(AnalyzeFile) \n \ - :Ctrle: MenuItem(EditGame) \n \ - :CtrlE: MenuItem(EditPosition) \n \ - :MetaO: MenuItem(ShowEngineOutput) \n \ - :MetaE: MenuItem(ShowEvaluationGraph) \n \ - :MetaG: MenuItem(ShowGameList) \n \ - :MetaH: MenuItem(ShowMoveHistory) \n \ - :Pause: MenuItem(Pause) \n \ - :F3: MenuItem(Accept) \n \ - :F4: MenuItem(Decline) \n \ - :F12: MenuItem(Rematch) \n \ - :F5: MenuItem(CallFlag) \n \ - :F6: MenuItem(Draw) \n \ - :F7: MenuItem(Adjourn) \n \ - :F8: MenuItem(Abort) \n \ - :F10: MenuItem(StopObserving) \n \ - :F11: MenuItem(StopExamining) \n \ + :CtrlS: MenuItem(File.SavePosition) \n \ + :CtrlC: MenuItem(Edit.CopyPosition) \n \ + :CtrlV: MenuItem(Edit.PastePosition) \n \ + :Ctrlq: MenuItem(File.Quit) \n \ + :Ctrlw: MenuItem(Mode.MachineWhite) \n \ + :Ctrlb: MenuItem(Mode.MachineBlack) \n \ + :Ctrlt: MenuItem(Mode.TwoMachines) \n \ + :Ctrla: MenuItem(Mode.AnalysisMode) \n \ + :Ctrlg: MenuItem(Mode.AnalyzeFile) \n \ + :Ctrle: MenuItem(Mode.EditGame) \n \ + :CtrlE: MenuItem(Mode.EditPosition) \n \ + :MetaO: MenuItem(View.EngineOutput) \n \ + :MetaE: MenuItem(View.EvaluationGraph) \n \ + :MetaG: MenuItem(View.GameList) \n \ + :MetaH: MenuItem(View.MoveHistory) \n \ + :Pause: MenuItem(Mode.Pause) \n \ + :F3: MenuItem(Action.Accept) \n \ + :F4: MenuItem(Action.Decline) \n \ + :F12: MenuItem(Action.Rematch) \n \ + :F5: MenuItem(Action.CallFlag) \n \ + :F6: MenuItem(Action.Draw) \n \ + :F7: MenuItem(Action.Adjourn) \n \ + :F8: MenuItem(Action.Abort) \n \ + :F10: MenuItem(Action.StopObserving) \n \ + :F11: MenuItem(Action.StopExamining) \n \ :Ctrld: MenuItem(DebugProc) \n \ :Meta CtrlF12: MenuItem(DebugProc) \n \ - :MetaEnd: MenuItem(ToEnd) \n \ - :MetaRight: MenuItem(Forward) \n \ - :MetaHome: MenuItem(ToStart) \n \ - :MetaLeft: MenuItem(Backward) \n \ - :Left: MenuItem(Backward) \n \ - :Right: MenuItem(Forward) \n \ - :Home: MenuItem(Revert) \n \ - :End: MenuItem(TruncateGame) \n \ - :Ctrlm: MenuItem(MoveNow) \n \ - :Ctrlx: MenuItem(RetractMove) \n \ - :MetaJ: MenuItem(Adjudications) \n \ - :MetaU: MenuItem(CommonEngine) \n \ - :MetaT: MenuItem(TimeControl) \n \ + :MetaEnd: MenuItem(Edit.ForwardtoEnd) \n \ + :MetaRight: MenuItem(Edit.Forward) \n \ + :MetaHome: MenuItem(Edit.BacktoStart) \n \ + :MetaLeft: MenuItem(Edit.Backward) \n \ + :Left: MenuItem(Edit.Backward) \n \ + :Right: MenuItem(Edit.Forward) \n \ + :Home: MenuItem(Edit.Revert) \n \ + :End: MenuItem(Edit.TruncateGame) \n \ + :Ctrlm: MenuItem(Engine.MoveNow) \n \ + :Ctrlx: MenuItem(Engine.RetractMove) \n \ + :MetaJ: MenuItem(Options.Adjudications) \n \ + :MetaU: MenuItem(Options.CommonEngine) \n \ + :MetaT: MenuItem(Options.TimeControl) \n \ :CtrlP: MenuItem(PonderNextMove) \n " #ifndef OPTIONSDIALOG "\ @@ -496,8 +495,8 @@ char globalTranslations[] = :CtrlH: MenuItem(HideThinkingProc) \n " #endif "\ - :F1: MenuItem(Manual) \n \ - :F2: MenuItem(FlipView) \n \ + :F1: MenuItem(Help.ManXBoard) \n \ + :F2: MenuItem(View.FlipView) \n \ :Return: TempBackwardProc() \n \ :Return: TempForwardProc() \n"; @@ -889,6 +888,16 @@ MainWindowUp () return xBoardWindow != 0; } +void SwitchWindow() +{ + extern Option dualOptions[]; + static Window dual; + Window tmp = xBoardWindow; + if(!dual) dual = XtWindow(dualOptions[3].handle); // must be first call + xBoardWindow = dual; // swap them + dual = tmp; +} + void PopUpStartupDialog () { // start menu not implemented in XBoard @@ -927,7 +936,7 @@ InitDrawingSizes (BoardSize boardSize, int flags) int i; static Dimension oldWidth, oldHeight; static VariantClass oldVariant; - static int oldDual = -1, oldMono = -1; + static int oldMono = -1; if(!formWidget) return; @@ -935,21 +944,15 @@ InitDrawingSizes (BoardSize boardSize, int flags) boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap); boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap); - if(boardWidth != oldWidth || boardHeight != oldHeight || oldDual != twoBoards) { // do resizing stuff only if size actually changed + if(boardWidth != oldWidth || boardHeight != oldHeight) { // do resizing stuff only if size actually changed - oldWidth = boardWidth; oldHeight = boardHeight; oldDual = twoBoards; + oldWidth = boardWidth; oldHeight = boardHeight; CreateGrid(); - hOffset = boardWidth + 10; - for(i=0; imax_logical_extent.height + 5; // add borderWidth + } +#else + appData.font = FindFont(appData.font, fontPxlSize); + appData.clockFont = FindFont(appData.clockFont, clockFontPxlSize); + appData.coordFont = FindFont(appData.coordFont, coordFontPxlSize); + clockFontID = XLoadFont(xDisplay, appData.clockFont); + clockFontStruct = XQueryFont(xDisplay, clockFontID); + coordFontID = XLoadFont(xDisplay, appData.coordFont); + coordFontStruct = XQueryFont(xDisplay, coordFontID); + // textHeight in !NLS mode! +#endif + countFontID = coordFontID; // [HGM] holdings + countFontStruct = coordFontStruct; + + xdb = XtDatabase(xDisplay); +#if ENABLE_NLS + XrmPutLineResource(&xdb, "*international: True"); + vTo.size = sizeof(XFontSet); + vTo.addr = (XtPointer) &fontSet; + XrmPutResource(&xdb, "*fontSet", XtRFontSet, &vTo); +#else + XrmPutStringResource(&xdb, "*font", appData.font); +#endif +} + int main (int argc, char **argv) { @@ -1111,10 +1171,8 @@ main (int argc, char **argv) XSetWindowAttributes window_attributes; Arg args[16]; Dimension timerWidth, boardWidth, boardHeight, w, h, sep, bor, wr, hr; - XrmValue vFrom, vTo; XtGeometryResult gres; char *p; - XrmDatabase xdb; int forceMono = False; srandom(time(0)); // [HGM] book: make random truly random @@ -1135,15 +1193,10 @@ main (int argc, char **argv) programName++; #ifdef ENABLE_NLS - XtSetLanguageProc(NULL, NULL, NULL); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); #endif - shellWidget = - XtAppInitialize(&appContext, "XBoard", shellOptions, - XtNumber(shellOptions), - &argc, argv, xboardResources, NULL, 0); appData.boardSize = ""; InitAppData(ConvertToLine(argc, argv)); p = getenv("HOME"); @@ -1154,10 +1207,6 @@ main (int argc, char **argv) snprintf(gameCopyFilename,i, "%s/.xboard%05uc.pgn", p, getpid()); snprintf(gamePasteFilename,i, "%s/.xboard%05up.pgn", p, getpid()); - XtGetApplicationResources(shellWidget, (XtPointer) &appData, - clientResources, XtNumber(clientResources), - NULL, 0); - { // [HGM] initstring: kludge to fix bad bug. expand '\n' characters in init string and computer string. static char buf[MSG_SIZ]; EscapeExpand(buf, appData.firstInitString); @@ -1189,12 +1238,6 @@ main (int argc, char **argv) setbuf(debugFP, NULL); } -#if ENABLE_NLS - if (appData.debugMode) { - fprintf(debugFP, "locale = %s\n", setlocale(LC_ALL, NULL)); - } -#endif - /* [HGM,HR] make sure board size is acceptable */ if(appData.NrFiles > BOARD_FILES || appData.NrRanks > BOARD_RANKS ) @@ -1206,13 +1249,31 @@ main (int argc, char **argv) #endif InitBackEnd1(); + gameInfo.variant = StringToVariant(appData.variant); + InitPosition(FALSE); + + shellWidget = + XtAppInitialize(&appContext, "XBoard", shellOptions, + XtNumber(shellOptions), + &argc, argv, xboardResources, NULL, 0); +#ifdef ENABLE_NLS + XtSetLanguageProc(NULL, NULL, NULL); + if (appData.debugMode) { + fprintf(debugFP, "locale = %s\n", setlocale(LC_ALL, NULL)); + } +#endif + + XtGetApplicationResources(shellWidget, (XtPointer) &appData, + clientResources, XtNumber(clientResources), + NULL, 0); + xDisplay = XtDisplay(shellWidget); xScreen = DefaultScreen(xDisplay); wm_delete_window = XInternAtom(xDisplay, "WM_DELETE_WINDOW", True); - gameInfo.variant = StringToVariant(appData.variant); - InitPosition(FALSE); - + /* + * determine size, based on supplied or remembered -size, or screen size + */ if (isdigit(appData.boardSize[0])) { i = sscanf(appData.boardSize, "%d,%d,%d,%d,%d,%d,%d", &squareSize, &lineGap, &clockFontPxlSize, &coordFontPxlSize, @@ -1269,12 +1330,6 @@ main (int argc, char **argv) tinyLayout = szd->tinyLayout; // [HGM] font: use defaults from settings file if available and not overruled } - if(!fontIsSet[CLOCK_FONT] && fontValid[CLOCK_FONT][squareSize]) - appData.clockFont = fontTable[CLOCK_FONT][squareSize]; - if(!fontIsSet[MESSAGE_FONT] && fontValid[MESSAGE_FONT][squareSize]) - appData.font = fontTable[MESSAGE_FONT][squareSize]; - if(!fontIsSet[COORD_FONT] && fontValid[COORD_FONT][squareSize]) - appData.coordFont = fontTable[COORD_FONT][squareSize]; /* Now, using squareSize as a hint, find a good XPM/XIM set size */ if (strlen(appData.pixmapDirectory) > 0) { @@ -1304,46 +1359,7 @@ XBoard square size (hint): %d\n\ /* * Determine what fonts to use. */ -#if ENABLE_NLS - appData.font = InsertPxlSize(appData.font, fontPxlSize); - appData.clockFont = InsertPxlSize(appData.clockFont, clockFontPxlSize); - appData.coordFont = InsertPxlSize(appData.coordFont, coordFontPxlSize); - fontSet = CreateFontSet(appData.font); - clockFontSet = CreateFontSet(appData.clockFont); - { - /* For the coordFont, use the 0th font of the fontset. */ - XFontSet coordFontSet = CreateFontSet(appData.coordFont); - XFontStruct **font_struct_list; - XFontSetExtents *fontSize; - char **font_name_list; - XFontsOfFontSet(coordFontSet, &font_struct_list, &font_name_list); - coordFontID = XLoadFont(xDisplay, font_name_list[0]); - coordFontStruct = XQueryFont(xDisplay, coordFontID); - fontSize = XExtentsOfFontSet(fontSet); // [HGM] figure out how much vertical space font takes - textHeight = fontSize->max_logical_extent.height + 5; // add borderWidth - } -#else - appData.font = FindFont(appData.font, fontPxlSize); - appData.clockFont = FindFont(appData.clockFont, clockFontPxlSize); - appData.coordFont = FindFont(appData.coordFont, coordFontPxlSize); - clockFontID = XLoadFont(xDisplay, appData.clockFont); - clockFontStruct = XQueryFont(xDisplay, clockFontID); - coordFontID = XLoadFont(xDisplay, appData.coordFont); - coordFontStruct = XQueryFont(xDisplay, coordFontID); - // textHeight in !NLS mode! -#endif - countFontID = coordFontID; // [HGM] holdings - countFontStruct = coordFontStruct; - - xdb = XtDatabase(xDisplay); -#if ENABLE_NLS - XrmPutLineResource(&xdb, "*international: True"); - vTo.size = sizeof(XFontSet); - vTo.addr = (XtPointer) &fontSet; - XrmPutResource(&xdb, "*fontSet", XtRFontSet, &vTo); -#else - XrmPutStringResource(&xdb, "*font", appData.font); -#endif + InitializeFonts(clockFontPxlSize, coordFontPxlSize, fontPxlSize); /* * Detect if there are not enough colors available and adapt. @@ -1360,16 +1376,6 @@ XBoard square size (hint): %d\n\ appData.monoMode = True; } - if (appData.lowTimeWarning && !appData.monoMode) { - vFrom.addr = (caddr_t) appData.lowTimeWarningColor; - vFrom.size = strlen(appData.lowTimeWarningColor); - XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); - if (vTo.addr == NULL) - appData.monoMode = True; - else - lowTimeWarningColor = *(Pixel *) vTo.addr; - } - if (appData.monoMode && appData.debugMode) { fprintf(stderr, _("white pixel = 0x%lx, black pixel = 0x%lx\n"), (unsigned long) XWhitePixel(xDisplay, xScreen), @@ -1410,6 +1416,7 @@ XBoard square size (hint): %d\n\ XtSetArg(args[1], XtNforeground, &buttonForegroundPixel); XtGetValues(optList[18].handle, args, 2); } + AppendEnginesToMenu(appData.recentEngineList); xBoardWindow = XtWindow(boardWidget); @@ -2268,60 +2275,24 @@ CreateGrid () } } -int nrOfMenuItems = 7; -Widget menuWidget[150]; -MenuListItem menuItemList[150] = { - { "LoadNextGameProc", LoadNextGameProc }, - { "LoadPrevGameProc", LoadPrevGameProc }, - { "ReloadGameProc", ReloadGameProc }, - { "ReloadPositionProc", ReloadPositionProc }, -#ifndef OPTIONSDIALOG - { "AlwaysQueenProc", AlwaysQueenProc }, - { "AnimateDraggingProc", AnimateDraggingProc }, - { "AnimateMovingProc", AnimateMovingProc }, - { "AutoflagProc", AutoflagProc }, - { "AutoflipProc", AutoflipProc }, - { "BlindfoldProc", BlindfoldProc }, - { "FlashMovesProc", FlashMovesProc }, -#if HIGHDRAG - { "HighlightDraggingProc", HighlightDraggingProc }, -#endif - { "HighlightLastMoveProc", HighlightLastMoveProc }, -// { "IcsAlarmProc", IcsAlarmProc }, - { "MoveSoundProc", MoveSoundProc }, - { "PeriodicUpdatesProc", PeriodicUpdatesProc }, - { "PopupExitMessageProc", PopupExitMessageProc }, - { "PopupMoveErrorsProc", PopupMoveErrorsProc }, -// { "PremoveProc", PremoveProc }, - { "ShowCoordsProc", ShowCoordsProc }, - { "ShowThinkingProc", ShowThinkingProc }, - { "HideThinkingProc", HideThinkingProc }, - { "TestLegalityProc", TestLegalityProc }, -#endif - { "AboutGameProc", AboutGameEvent }, - { "DebugProc", DebugProc }, - { "NothingProc", NothingProc }, - {NULL, NothingProc} -}; - void MarkMenuItem (char *menuRef, int state) { - int nr = MenuToNumber(menuRef); -return; - if(nr >= 0) { + MenuItem *item = MenuNameToItem(menuRef); + + if(item) { Arg args[2]; XtSetArg(args[0], XtNleftBitmap, state ? xMarkPixmap : None); - XtSetValues(menuWidget[nr], args, 1); + XtSetValues(item->handle, args, 1); } } void EnableMenuItem (char *menuRef, int state) { - int nr = MenuToNumber(menuRef); -return; - if(nr >= 0) XtSetSensitive(menuWidget[nr], state); + MenuItem *item = MenuNameToItem(menuRef); + + if(item) XtSetSensitive(item->handle, state); } void @@ -2340,28 +2311,15 @@ SetMenuEnables (Enables *enab) } } -int -Equal(char *p, char *s) -{ // compare strings skipping spaces in second - while(*s) { - if(*s == ' ') { s++; continue; } - if(*s++ != *p++) return 0; - } - return !*p; -} - void KeyBindingProc (Widget w, XEvent *event, String *prms, Cardinal *nprms) { // [HGM] new method of key binding: specify MenuItem(FlipView) in stead of FlipViewProc in translation string int i; char *p; + MenuItem *item; if(*nprms == 0) return; - for(i=0; menuItemList[i].name; i++) { - if(Equal(prms[0], menuItemList[i].name)) { - (menuItemList[i].proc) (); - return; - } - } + item = MenuNameToItem(prms[0]); + if(item) ((MenuProc *) item->proc) (); } static void @@ -2378,89 +2336,10 @@ MenuEngineSelect (Widget w, caddr_t addr, caddr_t index) RecentEngineEvent((int) (intptr_t) addr); } -// some stuff that must remain in front-end -static Widget mainBar, currentMenu; -static int wtot, nr = 0, widths[10]; - void -AppendMenuItem (char *text, char *name, MenuProc *action) -{ - int j; - Widget entry; - Arg args[16]; - - j = 0; - XtSetArg(args[j], XtNleftMargin, 20); j++; - XtSetArg(args[j], XtNrightMargin, 20); j++; - - if (strcmp(text, "----") == 0) { - entry = XtCreateManagedWidget(text, smeLineObjectClass, - currentMenu, args, j); - } else { - XtSetArg(args[j], XtNlabel, XtNewString(_(text))); - entry = XtCreateManagedWidget(name, smeBSBObjectClass, - currentMenu, args, j+1); - XtAddCallback(entry, XtNcallback, - (XtCallbackProc) (strcmp(name, "recent") ? MenuBarSelect : MenuEngineSelect), - (caddr_t) action); - menuWidget[nrOfMenuItems] = entry; - } -} - -void -CreateMenuButton (char *name, Menu *mb) -{ // create menu button on main bar, and shell for pull-down list - int i, j; - Arg args[16]; - Dimension w; - - j = 0; - XtSetArg(args[j], XtNmenuName, XtNewString(name)); j++; - XtSetArg(args[j], XtNlabel, XtNewString(_(mb->name))); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - mb->subMenu = XtCreateManagedWidget(mb->name, menuButtonWidgetClass, - mainBar, args, j); - currentMenu = XtCreatePopupShell(name, simpleMenuWidgetClass, - mainBar, NULL, 0); - j = 0; - XtSetArg(args[j], XtNwidth, &w); j++; - XtGetValues(mb->subMenu, args, j); - wtot += mb->textWidth = widths[nr++] = w; -} - -Widget -CreateMenuBar (Menu *mb, int boardWidth) +AppendMenuItem (char *msg, int n) { - int i, j; - Arg args[16]; - char menuName[MSG_SIZ]; - Dimension w; - Menu *ma = mb; - - // create bar itself - j = 0; - XtSetArg(args[j], XtNorientation, XtorientHorizontal); j++; - XtSetArg(args[j], XtNvSpace, 0); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - mainBar = XtCreateWidget("menuBar", boxWidgetClass, - formWidget, args, j); - - CreateMainMenus(mb); // put menus in bar according to description in back-end - - // size buttons to make menu bar fit, clipping menu names where necessary - while(wtot > boardWidth - 40) { - int wmax=0, imax=0; - for(i=0; i wmax) wmax = widths[imax=i]; - widths[imax]--; - wtot--; - } - for(i=0; inumber > 1) { - GameListPopUp(f, title); - return TRUE; - } - GameListDestroy(); - gameNumber = 1; - } - return LoadGame(f, gameNumber, title, FALSE); -} /* this variable is shared between CopyPositionProc and SendPositionSelection */ char *selected_fen_position=NULL; @@ -3305,41 +3162,6 @@ ManInner (Widget w, XEvent *event, String *prms, Cardinal *nprms) } void -DisplayMessage (char *message, char *extMessage) -{ - /* display a message in the message widget */ - - char buf[MSG_SIZ]; - Arg arg; - - if (extMessage) - { - if (*message) - { - snprintf(buf, sizeof(buf), "%s %s", message, extMessage); - message = buf; - } - else - { - message = extMessage; - }; - }; - - safeStrCpy(lastMsg, message, MSG_SIZ); // [HGM] make available - - /* need to test if messageWidget already exists, since this function - can also be called during the startup, if for example a Xresource - is not set up correctly */ - if(optList && optList[14].handle) - { - XtSetArg(arg, XtNlabel, message); - XtSetValues(optList[14].handle, &arg, 1); - }; - - return; -} - -void SetWindowTitle (char *text, char *title, char *icon) { Arg args[16]; @@ -3528,11 +3350,11 @@ StartClockTimer (long millisec) } void -DisplayTimerLabel (int optNr, char *color, long timer, int highlight) +DisplayTimerLabel (Option *opt, char *color, long timer, int highlight) { char buf[MSG_SIZ]; Arg args[16]; - Widget w = optList[optNr].handle; + Widget w = (Widget) opt->handle; /* check for low time warning */ Pixel foregroundOrWarningColor = timerForegroundPixel;