Help requested with morphic-related bug

David T. Lewis lewis at mail.msen.com
Mon Jan 2 22:47:42 UTC 2006


On Mon, Jan 02, 2006 at 11:51:52AM -0800, Kurt Thams wrote:
> David T. Lewis wrote:
> >On Sat, Dec 31, 2005 at 09:49:53PM +0100, karl wrote:
> >>>karl wrote:
> >>>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.
> >
> >Do this:
> >
> >WorldState addDeferredUIMessage: ["display your intermediate results"]
> >
> >It's perfectly OK to run background processes as you describe. All
> >you need to do is schedule the display parts to run in the Morphic
> >UI process using #addDeferredUIMessage:.
> >
> Meaning that the block which is the argument to addDeferredUIMessage: 
> contains the code which updates the Morphs?

Yes, that's right. The block contains some code that you want to have
evaluated in the Morphic user interface process. This will basically
happen "right away", so it does not appear to the user to be delayed
in any way. This makes for a good way to do an update of something
in the user interface while your computationally-intensive process
carries on with its work. Very simple if you know about it, and
very confusing if you don't ;-)

Dave




More information about the Squeak-dev mailing list