But try this code, and you will get my point:

| m |
m := Morph new.
m openInWorld.

m color: Color red.

1 to: 300 do: [:x |
        m extent: x@300.
        (Delay forMilliseconds: 10) wait.
].
m delete.


I want to see the animation of the growing morph.
Instead I get nothing.

To get the animation, you have to enclose the loop in a forked process,
but it is inelegant:

| m |
m := Morph new.
m openInWorld.

m color: Color red.

[1 to: 300 do: [:x |
        m extent: x@300.
        (Delay forMilliseconds: 10) wait.
].
m delete] fork.


Hilaire



On 20/06/2012 13:23, Fernando Olivero wrote:
> I don't think its related to the processes priority.
> 
> Can you provide more code of the  DrGeoCanvas>>#initialize ?
> 
> Because, the following works just fine, by evaluating the first two
> lines, or the complete script.
> 
> m := Morph new.
> m openInWorld.
> 
> m color: Color red.
> m extent: 300@300.
> 
> m delete
> 
> Fernando
> 
> On Wed, Jun 20, 2012 at 12:16 PM, Hilaire Fer
> nandes <hilaire.fernan...@edu.ge.ch> wrote:
>> DHello,
>>
>> I have a question regarding the Workspace when you execute code from there.
>>
>> Let me show with an example:
>>
>> I want to execute code instantiating an empty DrGeo sketch (a morph)
>> then create programmatically content:
>>
>>
>> |canvas|
>> canvas := DrGeoCanvas new.
>> canvas segment: 5@4 to: 10@20.
>> canvas vector: 0@0 to: 2@2.
>> ...
>>
>> The line with DrGeoCanavas creates and opens a new morph of a DrGeo sketch.
>>
>> My problem is: the morph only shows up on screen when the whole
>> Workspace code is executed. I would like the canvas morph to show up
>> when instantiated then get the construction code done step by step in
>> the screen.
>>
>> Is the workspace code executed with higher priority than the user
>> interface thread?
>>
>>
>> Thanks
>>
>> Hilaire
>>
>> --
>> Dr. Geo -- http://www.drgeo.eu
>>
>>
> 
> 


-- 
Dr. Geo -- http://www.drgeo.eu


Reply via email to