#QUALITY by cg
authorClaus Gittinger <cg@exept.de>
Thu, 01 Feb 2018 01:01:05 +0100
changeset 8284 a085dfe0614b
parent 8283 f0ea83eed994
child 8285 fcec3749083e
#QUALITY by cg class: View added: #displayOn: better debug support
View.st
--- a/View.st	Wed Jan 31 22:27:14 2018 +0100
+++ b/View.st	Thu Feb 01 01:01:05 2018 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -746,6 +748,29 @@
     super release.
 ! !
 
+!View methodsFor:'printing & storing'!
+
+displayOn:aStreamOrGC
+    "redefined to also give a hint of where I am"
+
+    |topView|
+
+    aStreamOrGC isStream ifFalse:[^ super displayOn:aStreamOrGC].
+
+    super displayOn:aStreamOrGC.
+    (topView := self topView) notNil ifTrue:[
+        (topView ~~ self) ifTrue:[
+            aStreamOrGC nextPutAll:' [in '.
+            topView application notNil ifTrue:[
+                topView application displayOn:aStreamOrGC
+            ] ifFalse:[
+                topView displayOn:aStreamOrGC
+            ].
+            aStreamOrGC nextPutAll:']'.
+        ].
+    ].
+! !
+
 !View class methodsFor:'documentation'!
 
 version