Kurt Thams wrote:
karl wrote:
Kurt Thams wrote:
I wrote a program to solve Sudoku puzzles, and when I run it I get a problem... various submorphs stop drawing (and get rendered as a red box with a yellow cross through it), and a walkback comes up with "Error: Error: Instances of UndefinedObject are not indexable" (in WorldState>>displayWorldSafely)
Not sure if I'm doing something wrong with my program or if it is an error in Morphic.
Essentially, I fork a process and set a morph to step while the forked process updates the model that the morph is drawing from.
Don't fork off a process. Morphic runs in a single thread and a you will get errors like this if you try using other processes. Use morphics step mechanism or if you _really_ have to use a seperate process use WorldState>>addDeferredUIMessage: Karl
So how do you properly use Morphic to display the intermediate results of a long-running, computationally-intensive process? This code could not be runing in the step method, otherwise the display would never update.
Would you have your computationally-intensive process running in a forked thread, and the implementor of "step" then alters the values underlying the morph objects?
Yup, that is the best way to do it. By the way, there is an other Sudoku solver on SqueakSource. I have not used it. karl