TextCollector.st
changeset 110 eb59f6e31e84
parent 97 cbf495fe3b64
child 119 59758ff5b841
--- a/TextCollector.st	Mon Mar 20 12:52:08 1995 +0100
+++ b/TextCollector.st	Sat Mar 25 23:21:46 1995 +0100
@@ -23,7 +23,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.15 1995-03-06 19:29:31 claus Exp $
+$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.16 1995-03-25 22:21:31 claus Exp $
 '!
 
 !TextCollector class methodsFor:'documentation'!
@@ -44,7 +44,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.15 1995-03-06 19:29:31 claus Exp $
+$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.16 1995-03-25 22:21:31 claus Exp $
 "
 !
 
@@ -54,7 +54,7 @@
     Instances of this view can take the place of a stream and display the 
     received text.
     Its main use in the system is the Transcript, but it can also be used for
-    things like trace-windows etc.
+    things like trace-windows, errorLogs etc.
 
     If collecting is turned on, a textcollector will not immediately display 
     entered text, but wait for some short time (timeDelay) and collect incoming 
@@ -68,7 +68,7 @@
     You can set linelimit to nil (i.e. no limit), but you may need a lot 
     of memory then ...
 
-    StyleSheet paramters:
+    StyleSheet paramters (transcript only):
 
 	transcriptForegroundColor       defaults to textForegroundColor
 	transcriptBackgroundColor'      defaults to textBackgroundColor.
@@ -101,6 +101,8 @@
 !TextCollector class methodsFor:'instance creation'!
 
 newTranscript
+    "create and open a new transcript."
+
     |topView transcript f v fg bg cFg cBg lines cols|
 
     topView := StandardSystemView label:'Transcript' minExtent:(100 @ 100).
@@ -119,30 +121,19 @@
     lines := self defaultTranscriptSize y.
     topView extent:(((f widthOf:'x') * cols) @ (f height * lines)).
 
-    Smalltalk at:#Transcript put:transcript.
-
-    "
-     fancy feature: whenever Transcript is closed, reset to StdError
-    "
-    transcript destroyAction:[Smalltalk at:#Transcript put:Stderr].
-
-    fg := StyleSheet colorAt:'transcriptForegroundColor' default:transcript foregroundColor.
-    bg := StyleSheet colorAt:'transcriptBackgroundColor' default:transcript backgroundColor.
-    transcript foregroundColor:fg backgroundColor:bg.
-    transcript viewBackground:bg.
-
-    cFg := StyleSheet colorAt:'transcriptCursorForegroundColor' default:bg.
-    cBg := StyleSheet colorAt:'transcriptCursorBackgroundColor' default:fg.
-    transcript cursorForegroundColor:cFg backgroundColor:cBg. 
+    transcript beTranscript.
 
     "
      run it at a slightly higher prio, to allow for
      delayed buffered updates to be performed
     "
     topView openWithPriority:(Processor userSchedulingPriority + 1).
-    "transcript lineLimit:1000. " "or whatever you think makes sense"
 
     ^ transcript
+
+    "
+     TextCollector newTranscript
+    "
 ! !
 
 !TextCollector methodsFor:'initialize / release'!
@@ -210,6 +201,30 @@
     super destroy
 ! !
 
+!TextCollector methodsFor:'transcript specials'!
+
+beTranscript
+    |fg bg cFg cBg|
+
+    Smalltalk at:#Transcript put:self.
+
+    "
+     fancy feature: whenever Transcript is closed, reset to StdError
+    "
+    self destroyAction:[Smalltalk at:#Transcript put:Stderr].
+
+    fg := StyleSheet colorAt:'transcriptForegroundColor' default:self foregroundColor.
+    bg := StyleSheet colorAt:'transcriptBackgroundColor' default:self backgroundColor.
+    self foregroundColor:fg backgroundColor:bg.
+    self viewBackground:bg.
+
+    cFg := StyleSheet colorAt:'transcriptCursorForegroundColor' default:bg.
+    cBg := StyleSheet colorAt:'transcriptCursorBackgroundColor' default:fg.
+    self cursorForegroundColor:cFg backgroundColor:cBg. 
+
+    "self lineLimit:1000. " "or whatever you think makes sense"
+! !
+
 !TextCollector methodsFor:'accessing'!
 
 collect:aBoolean