Index: /trunk/FACT++/gui/QCameraWidget.cc
===================================================================
--- /trunk/FACT++/gui/QCameraWidget.cc	(revision 11922)
+++ /trunk/FACT++/gui/QCameraWidget.cc	(revision 11923)
@@ -288,5 +288,5 @@
 
 
-     void QCameraWidget::highlightPixel(int idx)
+     void QCameraWidget::highlightPixel(int idx, bool highlight)
      {
          if (idx < 0 || idx > ACTUAL_NUM_PIXELS)
@@ -295,9 +295,21 @@
            return;
          }
-         highlightedPixels.push_back(idx);
-         if (isVisible())
-             updateGL();
-     }
-     void QCameraWidget::highlightPatch(int idx)
+
+         const vector<int>::iterator v = ::find(highlightedPixels.begin(), highlightedPixels.end(), idx);
+         if (highlight)
+         {
+             if (v==highlightedPixels.end())
+                 highlightedPixels.push_back(idx);
+         }
+         else
+         {
+             if (v!=highlightedPixels.end())
+                 highlightedPixels.erase(v);
+         }
+
+         if (isVisible())
+             updateGL();
+     }
+     void QCameraWidget::highlightPatch(int idx, bool highlight)
      {
          if (idx < 0 || idx > NTMARK)
@@ -306,5 +318,17 @@
              return;
          }
-         highlightedPatches.push_back(idx);
+
+         const vector<int>::iterator v = ::find(highlightedPatches.begin(), highlightedPatches.end(), idx);
+         if (highlight)
+         {
+             if (v==highlightedPatches.end())
+                 highlightedPatches.push_back(idx);
+         }
+         else
+         {
+             if (v!=highlightedPatches.end())
+                 highlightedPatches.erase(v);
+         }
+
          if (isVisible())
              updateGL();
Index: /trunk/FACT++/gui/QCameraWidget.h
===================================================================
--- /trunk/FACT++/gui/QCameraWidget.h	(revision 11922)
+++ /trunk/FACT++/gui/QCameraWidget.h	(revision 11923)
@@ -29,6 +29,6 @@
 
 public:
-    void highlightPixel(int idx);
-    void highlightPatch(int idx);
+    void highlightPixel(int idx, bool highlight=true);
+    void highlightPatch(int idx, bool highlight=true);
     void clearHighlightedPatches();
     void clearHighlightedPixels();
