Icon.st
changeset 1628 00275352f251
parent 1477 d0ede9f27f35
child 1656 d7e60eb61f02
equal deleted inserted replaced
1627:0da285e38f50 1628:00275352f251
    72 
    72 
    73 !Icon class methodsFor:'initialization'!
    73 !Icon class methodsFor:'initialization'!
    74 
    74 
    75 initialize
    75 initialize
    76     KnownIcons isNil ifTrue:[
    76     KnownIcons isNil ifTrue:[
    77         KnownIcons := Dictionary new
    77         KnownIcons := Dictionary new.
       
    78 	Color initialize.
    78     ]
    79     ]
    79 
    80 
    80     "
    81     "
    81      Icon initialize
    82      Icon initialize
    82     "
    83     "
   165 !
   166 !
   166 
   167 
   167 constantNamed:aName put:anImage
   168 constantNamed:aName put:anImage
   168     "register anImage under aName."
   169     "register anImage under aName."
   169 
   170 
       
   171     KnownIcons isNil ifTrue:[
       
   172 	self initialize
       
   173     ].
   170     KnownIcons at:aName put:anImage
   174     KnownIcons at:aName put:anImage
   171 
   175 
   172     "Modified: 23.4.1996 / 11:40:51 / cg"
   176     "Modified: 23.4.1996 / 11:40:51 / cg"
   173 !
   177 !
   174 
   178 
   175 constantNamed:aName searchForFile:doSearchForFile
   179 constantNamed:aName searchForFile:doSearchForFile
   176     "return the image registered under aName."
   180     "return the image registered under aName."
   177 
   181 
   178     |icon nm|
   182     |icon nm|
   179 
   183 
       
   184     KnownIcons isNil ifTrue:[
       
   185 	self initialize
       
   186     ].
   180     icon := KnownIcons at:aName ifAbsent:[].
   187     icon := KnownIcons at:aName ifAbsent:[].
   181 
   188 
   182     (icon isNil and:[doSearchForFile]) ifTrue:[
   189     (icon isNil and:[doSearchForFile]) ifTrue:[
   183         nm := self replacementNameFor:aName.
   190         nm := self replacementNameFor:aName.
   184         nm notNil ifTrue:[
   191         nm notNil ifTrue:[
   619 ! !
   626 ! !
   620 
   627 
   621 !Icon class methodsFor:'documentation'!
   628 !Icon class methodsFor:'documentation'!
   622 
   629 
   623 version
   630 version
   624     ^ '$Header: /cvs/stx/stx/libview2/Icon.st,v 1.30 2001-06-08 16:14:54 cg Exp $'
   631     ^ '$Header: /cvs/stx/stx/libview2/Icon.st,v 1.31 2002-10-02 09:35:53 cg Exp $'
   625 ! !
   632 ! !
   626 Icon initialize!
   633 Icon initialize!