[Cuis-dev] background color of LayoutMorphs in a SystemWindow

Hilaire Fernandes hfern at free.fr
Sun Feb 9 01:19:26 PST 2025


I find the color scheme a bit confusing with Widget. Your interest is 
welcome. Nevertheless, adding a dedicated flag to each LayoutMorph (we 
have a lot) may be overkill and would add confusion to an already a bit 
confusing system - at least for me.

Have you tried exploring the doAdoptWidgetsColor.

When changing as this (change in line 4):

1
2
3
4
5

	

LayoutMorph>>adoptWidgetsColor: paneColor
     super adoptWidgetsColor: paneColor.
     doAdoptWidgetsColor
         ifTrue: [self color: (Theme current buttonColorFrom: *color*) ]
         ifFalse: [self color: `Color transparent` ]

Then your code example as (addition at line 3):

1
2
3
4
5
6
7

	

window := SystemWindow new.
column := window layoutMorph.
column doAdoptWidgetsColor.
column color: Color yellow.
column addMorph: (LabelMorph contents: 'foo').
column addMorph: (LabelMorph contents: 'bar').
window openInWorld.

This achieve what your are looking for without an additional variable. I 
have not explored much about the possible consequences.

-- 
http://mamot.fr/@drgeo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250209/e0cc9a38/attachment.htm>


More information about the Cuis-dev mailing list