diff bin/curvecalc @ 519:f2dbb0b1fb35

optimize the number of curve redraws at curvecalc's startup Ignore-this: 4498afcf51bfdba37a7c0cfe12596958
author drewp@bigasterisk.com
date Mon, 29 Jun 2009 04:40:34 +0000
parents f15ffbfc5cd6
children 8d6f6d8a4719
line wrap: on
line diff
--- a/bin/curvecalc	Mon Jun 29 04:09:40 2009 +0000
+++ b/bin/curvecalc	Mon Jun 29 04:40:34 2009 +0000
@@ -466,9 +466,9 @@
         panes.add('subterms')
         panes.pack(side='top', fill='both', expand=True)
 
-        csv = Curvesetview(panes.subwidget('curvesetView'), curveset,
-                           height=400)
-        csv.pack(fill='both', expand=True)
+        curvesetView = Curvesetview(panes.subwidget('curvesetView'), curveset,
+                                    height=400)
+        curvesetView.pack(fill='both', expand=True)
 
         subtermArea = tk.Frame(panes.subwidget('subterms'), height=100)
         subtermArea.pack(fill='both', expand=True)
@@ -497,6 +497,11 @@
     
     dispatcher.send("max time",maxtime=maxtime)
     dispatcher.send("show all")
+    
+    # this is scheduled after some tk shuffling, to try to minimize
+    # the number of times we redraw the curve at startup. If tk is
+    # very slow, it's ok. You'll just get some wasted redraws.
+    reactor.callLater(.1, curvesetView.goLive)
 
     tksupport.install(root, ms=10)
     log.debug("run")