Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.640.mcz ==================== Summary ==================== Name: Morphic-nice.640 Author: nice Time: 24 February 2013, 6:35:47.345 pm UUID: ad3e00cc-256f-4358-8879-83ae19baf939 Ancestors: Morphic-tfel.639 Diminish excessive usage of ReadWriteStream =============== Diff against Morphic-tfel.639 =============== Item was removed: - (PackageInfo named: 'Morphic') postscriptOfRemoval: 'nil'! Item was removed: - (PackageInfo named: 'Morphic') preamble: 'nil'! Item was changed: ----- Method: MenuIcons class>>importIconNamed: (in category 'import/export') ----- importIconNamed: aString "self importIconNamed: 'appearanceIcon'" "will create a method appearanceIconContents holding the string representation of the icon, and a method appearanceIcon to access a form built using that string" | writer image stream | writer := GIFReadWriter on: (FileStream fileNamed: './icons/', aString, '.gif'). image := [ writer nextImage] ensure: [writer close]. "store string representation" + stream := String new writeStream. - stream := ReadWriteStream on: (String new). stream nextPutAll: aString, 'Contents' ; cr. stream nextPutAll: (self methodStart: aString). image storeOn: stream. stream nextPutAll: self methodEnd. - stream close. MenuIcons class compile: stream contents classified: 'private - icons' notifying: nil. "create accessor method" + stream := String new writeStream. - stream := ReadWriteStream on: (String new). stream nextPutAll: aString ; cr. stream nextPutAll: (self methodAccessorFor: aString). MenuIcons class compile: stream contents classified: 'accessing - icons' notifying: nil. - ^ stream contents! Item was changed: ----- Method: MenuIcons class>>importPngIconNamed: (in category 'import/export') ----- importPngIconNamed: aString "self importIconNamed: 'appearanceIcon'" "will create a method appearanceIconContents holding the string representation of the icon, and a method appearanceIcon to access a form built using that string" | writer image stream | writer := PNGReadWriter on: (FileStream fileNamed: './icons/', aString, '.png'). image := [ writer nextImage] ensure: [writer close]. "store string representation" + stream := String new writeStream. - stream := ReadWriteStream on: (String new). stream nextPutAll: aString, 'Contents' ; cr. stream nextPutAll: (self methodStart: aString). image storeOn: stream. stream nextPutAll: self methodEnd. - stream close. MenuIcons class compile: stream contents classified: 'private - icons' notifying: nil. "create accessor method" + stream := String new writeStream. - stream := ReadWriteStream on: (String new). stream nextPutAll: aString ; cr. stream nextPutAll: (self methodAccessorFor: aString). MenuIcons class compile: stream contents classified: 'accessing - icons' notifying: nil. - ^ stream contents! |
Free forum by Nabble | Edit this page |