InterestConverter.st
branchjv
changeset 17966 8b5df02e171f
parent 17911 a99f15c5efa5
child 18011 deb0c3355881
--- a/InterestConverter.st	Fri Sep 07 13:46:06 2012 +0100
+++ b/InterestConverter.st	Fri Sep 07 17:24:32 2012 +0100
@@ -202,8 +202,28 @@
 
 !InterestConverter methodsFor:'printing'!
 
-displayString
-    ^ self className , '(sending ' , selector storeString , ' to ' , destination printString , ')'
+displayOn:aGCOrStream
+    "Compatibility
+     append a printed desription on some stream (Dolphin,  Squeak)
+     OR:
+     display the receiver in a graphicsContext at 0@0 (ST80).
+     This method allows for any object to be displayed in some view
+     (although the fallBack is to display its printString ...)"
+
+    "/ what a kludge - Dolphin and Squeak mean: printOn: a stream;
+    "/ ST/X (and some old ST80's) mean: draw-yourself on a GC.
+    aGCOrStream isStream ifFalse:[
+        ^ super displayOn:aGCOrStream.
+    ].
+
+    aGCOrStream 
+        nextPutAll:self class name;
+        nextPutAll:'(sending '.
+
+    selector storeOn:aGCOrStream.
+    aGCOrStream nextPutAll:' to '.
+    destination printOn:aGCOrStream.
+    aGCOrStream nextPut:$).
 ! !
 
 !InterestConverter methodsFor:'testing'!
@@ -215,11 +235,11 @@
 !InterestConverter class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/InterestConverter.st,v 1.15 2009/05/28 06:01:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/InterestConverter.st,v 1.16 2012/08/03 15:52:54 stefan Exp $'
 !
 
 version_SVN
-    ^ '$Id: InterestConverter.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: InterestConverter.st 10844 2012-09-07 16:24:32Z vranyj1 $'
 ! !