Hi
I'm porting my env to 3.8 and I have the following problem (which worked like a charm in 3.7). The loadImage: method normally load a form store in a file.
loadImage: aString "Load an image from a file and install it as new graphics"
| stream res | stream := FileStream readOnlyFileNamed: aString, '.frm'. res := Compiler new evaluate: stream in: nil to: nil notifying: nil ifFail: [nil]. res isNil ifTrue: [PopUpMenu inform: 'Problem with the file ', aString, '.frm'] ifFalse: [(res isKindOf: Form) ifTrue: [self image: res]]
the file is of this form:
(Form extent: 70@78 depth: 16 fromArray: #( 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0....... 0 0) offset: 0@0)
Apparently now the res := Compiler new evaluate: stream in: nil to: nil notifying: nil ifFail: [nil]. returns nil when the stream is a MultiByteFileStream
So what is the best way to obtain an stream working the old way?
Stef
forget this is not from there the problem. Sorry
On 26 févr. 05, at 21:43, stéphane ducasse wrote:
Hi
I'm porting my env to 3.8 and I have the following problem (which worked like a charm in 3.7). The loadImage: method normally load a form store in a file.
loadImage: aString "Load an image from a file and install it as new graphics"
| stream res | stream := FileStream readOnlyFileNamed: aString, '.frm'. res := Compiler new evaluate: stream in: nil to: nil notifying: nil ifFail: [nil]. res isNil ifTrue: [PopUpMenu inform: 'Problem with the file ', aString, '.frm'] ifFalse: [(res isKindOf: Form) ifTrue: [self image: res]]
the file is of this form:
(Form extent: 70@78 depth: 16 fromArray: #( 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0....... 0 0) offset: 0@0)
Apparently now the res := Compiler new evaluate: stream in: nil to: nil notifying: nil ifFail: [nil]. returns nil when the stream is a MultiByteFileStream
So what is the best way to obtain an stream working the old way?
Stef
squeak-dev@lists.squeakfoundation.org