Fuel and Bloc: error on materializing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fuel and Bloc: error on materializing

chicoary
This post was updated on .
The code below works but it turns out the error "Message Not Understood: receiver of" noticeMouseOver "is nil" when the mouse passes over the morph.

| container materializedObject objectToSerlialize |
container := BlMorph new withRectangleViewDo: [ :v | v extent: 200@200. v color: Color lightCyan ].
objectToSerlialize := BlMorph new withRectangleViewDo: [ :v | v extent: 20@20. v color: Color blue].
container openInWorld.
container addMorphCentered: objectToSerlialize.
self confirm: 'Save?'.
FLSerializer serialize: objectToSerlialize toFileNamed: 'demo.fuel'.
self confirm: 'Delete?'.
objectToSerlialize delete.
self confirm: 'Restore?'.
materializedObject := FLMaterializer materializeFromFileNamed: 'demo.fuel'.
container addMorph: materializedObject

The code can also be seen in http://ws.stfx.eu/JX06871AMDH0.

I am very grateful for any help to fix or avoid the error.
Reply | Threaded
Open this post in threaded view
|

Re: Fuel and Bloc: error on materializing

chicoary
I found that the materialized object did not have a reference to the Bloc space. With the line of code introduced below the error disappeared.

| container materializedObject objectToSerlialize |
container := BlMorph new withRectangleViewDo: [ :v | v extent: 200@200. v color: Color lightCyan ].
objectToSerlialize := BlMorph new withRectangleViewDo: [ :v | v extent: 20@20. v color: Color blue].
container openInWorld.
container addMorphCentered: objectToSerlialize.
self confirm: 'Save?'.
FLSerializer serialize: objectToSerlialize toFileNamed: 'demo.fuel'.
self confirm: 'Delete?'.
objectToSerlialize delete.
self confirm: 'Restore?'.
materializedObject := FLMaterializer materializeFromFileNamed: 'demo.fuel'.

"Restoring Bloc space"
materializedObject space: container space.

container addMorph: materializedObject