--- a/Icon.st Tue Jan 27 14:31:52 1998 +0100
+++ b/Icon.st Tue Jan 27 17:20:33 1998 +0100
@@ -161,6 +161,22 @@
"Modified: 10.1.1997 / 17:52:06 / cg"
!
+constantNamed:aName ifAbsentPut: aBlock
+ "if an image for aName is registered, return it;
+ otherwise, register the result from evaluating aBlock
+ (which also could be a value holder) and return it."
+
+ |image|
+
+ (image := self constantNamed: aName) isNil
+ ifTrue:
+ [
+ self constantNamed: aName put: (image := aBlock value)
+ ].
+ ^image
+
+!
+
constantNamed:aName put:anImage
"register anImage under aName."
@@ -172,6 +188,6 @@
!Icon class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/Icon.st,v 1.14 1997-01-10 17:59:45 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/Icon.st,v 1.15 1998-01-27 16:20:33 tz Exp $'
! !
Icon initialize!