Method.st
changeset 3052 f384e7082ee9
parent 3030 fc5d632d133f
child 3123 e7bdadf03256
equal deleted inserted replaced
3051:29d10c26d6a3 3052:f384e7082ee9
  2073     ^ history at:self ifAbsent:nil
  2073     ^ history at:self ifAbsent:nil
  2074 
  2074 
  2075     "Modified: 7.11.1996 / 19:06:22 / cg"
  2075     "Modified: 7.11.1996 / 19:06:22 / cg"
  2076 !
  2076 !
  2077 
  2077 
       
  2078 resourceType
       
  2079     "ST-80 compatibility:
       
  2080      return the methods first resource specs key; either nil, 
       
  2081      or a single symbol such as #canvas, #menu etc.
       
  2082      Since VW programs do not expect the additional ST/X resources,
       
  2083      these are ignored here - therefore only one of
       
  2084      #canvas, #menu, #image or nil are returned (for now)"
       
  2085 
       
  2086     self hasResource ifFalse:[^ nil].
       
  2087     self resources keysAndValuesDo:[:key :val |
       
  2088                                         (#(
       
  2089                                             canvas
       
  2090                                             image
       
  2091                                             menu
       
  2092                                         ) includes:key) ifTrue:[
       
  2093                                             ^ key
       
  2094                                         ]
       
  2095                                    ].
       
  2096     ^ nil
       
  2097 
       
  2098     "Created: / 27.10.1997 / 14:10:58 / cg"
       
  2099     "Modified: / 28.10.1997 / 13:24:18 / cg"
       
  2100 !
       
  2101 
       
  2102 resources
       
  2103     "return the methods resource spec; either nil, a single symbol
       
  2104      or a collection of symbols."
       
  2105 
       
  2106     |src parser|
       
  2107 
       
  2108     self hasResource ifFalse:[^ nil].
       
  2109 
       
  2110     src := self source.
       
  2111     src isNil ifTrue:[
       
  2112         ^ nil "/ actually: dont know
       
  2113     ].
       
  2114 
       
  2115     (src findString:'resource:') == 0 ifTrue:[
       
  2116         ^ nil "/ actually: error
       
  2117     ].
       
  2118     parser := Parser
       
  2119                     parseMethod:src 
       
  2120                     in:nil 
       
  2121                     ignoreErrors:true 
       
  2122                     ignoreWarnings:true.
       
  2123 
       
  2124     ^ parser primitiveResources.
       
  2125 
       
  2126     "Created: / 26.10.1997 / 16:23:18 / cg"
       
  2127 !
       
  2128 
  2078 selector
  2129 selector
  2079     "return the selector under which I am found in my containingClasses
  2130     "return the selector under which I am found in my containingClasses
  2080      method-table. 
  2131      method-table. 
  2081      See comment in who."
  2132      See comment in who."
  2082 
  2133 
  2438 ! !
  2489 ! !
  2439 
  2490 
  2440 !Method class methodsFor:'documentation'!
  2491 !Method class methodsFor:'documentation'!
  2441 
  2492 
  2442 version
  2493 version
  2443     ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.142 1997-10-15 12:32:25 cg Exp $'
  2494     ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.143 1997-10-28 18:31:50 cg Exp $'
  2444 ! !
  2495 ! !
  2445 Method initialize!
  2496 Method initialize!