[Cuis-dev] Rebuilding on events: Experiments in simplifying UI development in Cuis inspired by Mithril.js

Hilaire Fernandes hfern at free.fr
Tue May 16 09:24:36 PDT 2023


Le 14/05/2023 à 19:47, Paul D. Fernhout via Cuis-dev a écrit :
> For an example related to Cuis and unexpected complex behavior, I was 
> debugging why the background color of the experiment I worked on 
> suddenly turned light brown as soon as the window was rebuilt. It 
> ultimately had to do with the original LayoutMorphs having a 
> transparent background color somehow, but for some reasons the new 
> ones the code made had a light brown color. I could not easily figure 
> out why that was the case (like where the original LayoutMorph got its 
> color set). I spent a lot of time drilling down into the submorphs of 
> the window, past layers and layers of LayoutMorphs.

AFAIK, it is related to #adoptWidgetsColor: to have the option of 
uniform color among widgets in a pane.

There is a doAdoptwidgetColor boolean attribute.

>
> And my conclusion from all that debugging was that the idea of an 
> invisible LayoutMorph that Cuis uses is an anti-pattern. 😄
>
> Those extra morphs made it harder to understand what was going on when 
> inspecting windows. I'd rather see morphs hold directly onto their 
> (visible) submorphs and hold onto a layout object of some sort that 
> moves submorphs around as needed. That would make it easier to inspect 
> a tree of (visible) morphs. To me, every morph having an optional 
> layout object to arrange submorphs also would be simpler conceptually 
> than having mysterious invisible-sometimes morphs in between all other 
> morphs, because it would be a separation of concerns of layout from 
> display. With a replaceable layout object, people could also more 
> easily experiment with all sorts of layout options like Swing and HTML 
> have (like MiGLayout or FlexBox which I  have found useful).

You need to layout morph where to insert the morphs. You may have space 
separation between these morphs revealing the underneath layout morph. 
You may want to experiment with the UI-Layout-Panel and UI-Frame 
packages. Once installed in a Morph, called its menu from its halo then 
select menu items Edit me |Edit my Layout Spec. I found the tools 
difficult to use, but it may be just me.

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/20230516/fcb90303/attachment.htm>


More information about the Cuis-dev mailing list