From 86930da6afe672666131d7fe8f887b2635518fde Mon Sep 17 00:00:00 2001
From: Mike Curtis <Michael.C.Curtis@gmail.com>
Date: Thu, 11 Apr 2013 17:26:45 -0500
Subject: [PATCH] Delay refresh while speeding through game

---
 tcl/windows/pgn.tcl |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/tcl/windows/pgn.tcl b/tcl/windows/pgn.tcl
index e3ca1c1..8be8220 100644
--- a/tcl/windows/pgn.tcl
+++ b/tcl/windows/pgn.tcl
@@ -362,11 +362,24 @@ namespace eval pgn {
   ################################################################################
   # ::pgn::Refresh
   #
+  #  Delay refresh while speeding through game
+  ################################################################################
+  proc Refresh { {pgnNeedsUpdate 0} } {
+    if {$pgnNeedsUpdate} {
+      ::pgn::Refresh2 $pgnNeedsUpdate
+    }  else {
+      after cancel ::pgn::Refresh2
+      after 250 ::pgn::Refresh2
+    }  
+  }
+  ################################################################################
+  # ::pgn::Refresh2
+  #
   #    Updates the PGN window. If $pgnNeedsUpdate == 0, then the
   #    window text is not regenerated; only the current and next move
   #    tags will be updated.
   ################################################################################
-  proc Refresh { {pgnNeedsUpdate 0} } {
+  proc Refresh2 { {pgnNeedsUpdate 0} } {
     if {![winfo exists .pgnWin]} { return }
 
     if {$pgnNeedsUpdate} {
-- 
1.7.9.5

