Add game-list callbacks
[xboard.git] / nengineoutput.c
index dc84aa4..774d63a 100644 (file)
@@ -104,14 +104,14 @@ MemoProc (Option *opt, int n, int x, int y, char *text, int index)
       case 3: // press button 3
        pressed = 1;
        if(LoadMultiPV(x, y, text, index, &start, &end, currentPV)) {
-#ifdef TODO_GTK
-           XawTextSetSelection( w, start, end );
-#endif
            highTextStart[currentPV] = start; highTextEnd[currentPV] = end;
+           HighlightText(&engoutOptions[currentPV ? 12 : 5], start, end, TRUE);
        }
        break;
       case -3: // release button 3
        pressed = 0;
+        if(highTextStart[currentPV] != highTextEnd[currentPV])
+            HighlightText(&engoutOptions[currentPV ? 12 : 5], highTextStart[currentPV], highTextEnd[currentPV], FALSE);
         highTextStart[currentPV] = highTextEnd[currentPV] = 0;
         UnLoadPV();
        break;
@@ -155,8 +155,8 @@ EngineOutputPopUp ()
     if (GenericPopUp(engoutOptions, _(title), EngOutDlg, BoardWindow, NONMODAL, 1)) {
        if(engoutOptions[STRIDE-1].type != Break)
            DisplayFatalError(_("Mismatch of STRIDE in nengineoutput.c\nChange and recompile!"), 0, 2);
-       AddHandler(&engoutOptions[MEMO], 6);
-       AddHandler(&engoutOptions[MEMO+STRIDE], 6);
+       AddHandler(&engoutOptions[MEMO], EngOutDlg, 6);
+       AddHandler(&engoutOptions[MEMO+STRIDE], EngOutDlg, 6);
        if( needInit ) {
            InitEngineOutput(&engoutOptions[0], &engoutOptions[MEMO]); // make icon bitmaps
            needInit = FALSE;