# HG changeset patch # User Stefan Vogel # Date 1344009210 -7200 # Node ID 1561011a34fd4cd1111982601ee69fe1567314b9 # Parent 1b8f3e94952a3d05de186ac59e9a9f45791115cb Implement #displayOn: instead of #displayString diff -r 1b8f3e94952a -r 1561011a34fd MessageSend.st --- a/MessageSend.st Fri Aug 03 17:53:25 2012 +0200 +++ b/MessageSend.st Fri Aug 03 17:53:30 2012 +0200 @@ -269,10 +269,27 @@ !MessageSend methodsFor:'printing & storing'! -displayString - "return a string for display in inspectors etc." +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 ...)" - ^ self class name , '(' , receiver displayString , '>>' , selector , ')' + "/ 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; + nextPut:$(. + receiver displayOn:aGCOrStream. + aGCOrStream nextPutAll:'>>'. + selector storeOn:aGCOrStream. + aGCOrStream nextPut:$) ! printOn:aStream @@ -289,9 +306,9 @@ !MessageSend class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.23 2010-12-22 12:50:41 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.24 2012-08-03 15:53:30 stefan Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.23 2010-12-22 12:50:41 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.24 2012-08-03 15:53:30 stefan Exp $' ! !