[Zooimage-commits] r95 - pkg/zooimage/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 21 11:30:15 CEST 2009


Author: romain
Date: 2009-04-21 11:30:07 +0200 (Tue, 21 Apr 2009)
New Revision: 95

Modified:
   pkg/zooimage/R/utilities.r
Log:
factoring backspaces and ClearProgress out of Progress

Modified: pkg/zooimage/R/utilities.r
===================================================================
--- pkg/zooimage/R/utilities.r	2009-04-21 09:22:26 UTC (rev 94)
+++ pkg/zooimage/R/utilities.r	2009-04-21 09:30:07 UTC (rev 95)
@@ -464,15 +464,15 @@
     l <- nchar(Max.Value)
     Value <- formatC(round(value), width = l)
     if (percent) {
-        backspaces <- paste(rep("\b", l + 14), collapse = "")
-        if (erase.only) { 
+        backspaces <- backspaces( l + 14 )
+		if (erase.only) { 
             message <- ""
         } else {
 			message <- paste("Progress: ", Value, "%  ", sep = "")
 		}
         cat(backspaces, message, sep = "")
     } else {
-        backspaces <- paste(rep("\b", 2 * l + 16), collapse = "")
+        backspaces <- backspaces( 2 * l + 16)
         if (erase.only) { 
             message <- ""
         } else {
@@ -501,8 +501,16 @@
     invisible(NULL)
 }
 ClearProgress <- function( ){
-	Progress( 2, 1 )
+	cat(backspaces(), "", sep = "")
+	if ("ZIDlgWin" %in% WinNames()) {
+		rmTemp("statusBusy")
+		tkconfigure( getTemp("statusProg") , value = 0)
+		tkconfigure( getTemp("statusText") , text = paste("Ready -", getwd()))
+	}
 }
+backspaces <- function( n = getOption("width") ){
+	paste( rep("\b",  ), collapse = "" )
+}
 # }}}
 
 # {{{ Setwd



More information about the Zooimage-commits mailing list