[Cuis-dev] Siren for Cuis - initial (partial) port

Hilaire Fernandes hfern at free.fr
Fri Nov 25 14:29:01 PST 2022


Hi Stephen,


Le 24/11/2022 à 20:09, Stephen Travis Pope via Cuis-dev a écrit :
>
> Hello colleagues,
>
> The core of the Siren music/audio package is running on Cuis, and I'm 
> proceeding to port the I/O classes and looking for some help with the 
> graphics back-end.
>
Cool and great :-)

>
> Q: Is there a Morphic display-list view?  In Siren, most of the GUIs 
> are based on a simple display-list view with 2-D scrolling and zooming 
> (i.e., 4 “scroll” bars) as in these examples,
>
Basically, any kind of Morph can be a display-list view. To a morph you 
can add morphs, named in this context submorphs, the parent morph is 
named the owner. Such submorphs as PlacedMorph are positioned with the 
morphPosition message, according to the origin in the owner morph, which 
is not always the top-left corner as in Squeak or Pharo. Cuis Morphic3  
really improve the framework compare to Pharo/Squeak.

If you use the special LayoutMorph as the owner, you set layout rules 
for automatic positioning of the submorphs. I don't think this is what 
you want, but may be for the score.

For DrGeo geometry canvas, a bit like your display-list, I defined an 
owner as a kind of BoxedMorph, then defined submorph as direct subclass 
of Morph, to reduce the number of attributes and also because it was not 
easy to make sense for some geometric object to have it as PlacedMorph.

I see 3 different several scenarii to design the equivalent of your 
display-list. In each scenario, the owner as a Morph then each type of 
object you add to your display-list will be defined as specific Morph 
class. For each scenario :

1) owner is a LayoutMorph, then each submorph is added with its layout 
rule. It is unlikely what you want.

2) owner is a PlacedMorph, and submorphs are also kind of PlacedMorph, 
you position the submorphs in the owner with the morphPosition: message. 
You can also rotate and scale the submoprh (Read 
https://cuis-smalltalk.github.io/TheCuisBook/A-Clock-Morph.html)

3) owner is a PlacedMoprh and submoprh are direct subclasses of Morph. 
You can't set the position of a submorph with the morphPosition: message 
(there is not such position attributes), you directly draw the morph 
according to its model. This is what I do in DrGeo geometric canvas 
(Explore its DrGMorph hierarchy)

Hope this helps

Hilaire

-- 
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20221125/a742b062/attachment.htm>


More information about the Cuis-dev mailing list