[Cuis-dev] [RFC][Proposal] Refactoring of World Morph

Juan Vuletich juan at jvuletich.org
Sun Oct 25 17:19:53 PDT 2020


Hi Hilaire,

On 10/24/2020 11:04 AM, Hilaire Fernandes via Cuis-dev wrote:
>
> Hi Juan,
>
> What will be left to a PasteUpMorph? What a PasteUpMorph can do a 
> Morph can't. For DrGeo I still use a PasteUpMorph for the drawable, 
> but I am not sure it is mandatory, and it is for historical reason 
> because of tile programming then
>

Very little. The morph drag and drop, background image and some event 
and halo stuff. Not sure if all that is really needed, though.

> If I am right, in Squeak's PasteUpMorph the purpose is let user drop 
> morphs of any kind for visual programming with tiles.
>
> In The Cuis base image, all instances of PasteUpMorph are World.
>
> By the way I met this funny behavior:
>
>     *PasteUpMorph newWorld;newWorld;newWorld. (repeat at will)*
>     **PasteUpMorph allInstances*
>     *=>  #( [world]  [world]  [world]  [world]  [world])*
>     PasteUpMorph allInstances
>     =>  #( [world]  [world])*
>
> Duplicated World seems to vanish.
>

That's because you are not referencing them, and they get collected.

> Then:
>
> *PasteUpMorph newWorld openInWorld*
>
> makes the environment unhappy.
>

Yep. This does the trick, though:
[
     UISupervisor stopUIProcess.
     w _ WorldMorph newWorld.
     w
         recreateDefaultDesktop;
         showTaskbar.
     UISupervisor spawnNewMorphicProcessFor: w.
] forkAt: 41

> As long as there is only one World correctly handled in Cuis, it makes 
> sense to safeguard the environment with a singleton or alike behavior.
>
> AFAIK, there is no such things as Squeak's Project in Cuis.
>

But it is really easy to make. I don't think we'd make people refrain 
from trying.

> Take care
>
> Hilaire
>
> -- 
> GNU Dr. Geo
> http://drgeo.eu
> https://pouet.chapril.org/@hilaire

Thanks,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20201025/d1d19b86/attachment.htm>


More information about the Cuis-dev mailing list