Icon.st
changeset 1187 a5978013d0ad
parent 1177 732fb35f7239
child 1190 91cf6653901e
--- a/Icon.st	Sun Jun 06 00:16:36 1999 +0200
+++ b/Icon.st	Fri Jun 18 22:36:47 1999 +0200
@@ -176,6 +176,17 @@
 
 !
 
+constantNamed:aName ifAbsentPutImageFromFile:aFileName
+    "if an image for aName is registered, return it;
+    otherwise, load the image from aFileName (searched in bitmaps directories),
+    register the result and return it."
+
+    self Icon
+        constantNamed:aName
+        ifAbsentPut:[Image fromFile:aFileName]
+
+!
+
 constantNamed:aName put:anImage
     "register anImage under aName."
 
@@ -531,6 +542,6 @@
 !Icon class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/Icon.st,v 1.21 1999-05-25 13:53:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/Icon.st,v 1.22 1999-06-18 20:36:47 cg Exp $'
 ! !
 Icon initialize!