[Cuis-dev] layoutSubmorphs vs. redrawNeeded

Juan Vuletich juan at cuis.st
Mon Aug 7 11:08:41 PDT 2023


Hi Folks,

(inline)
On 8/4/2023 12:19 PM, ken.dickey--- via Cuis-dev wrote:
> I think the attached does the right thing (immediate update).
>
> Needs review and more testing.
>
> Busy now, gotta go.
>
> Good on ya,
> -KenD

Thanks Ken. I only had to tweak a couple of details to make it suitable 
for the base image. Just pushed it to GitHub.

> On 2023-08-03 11:55, Szabolcs Komáromi via Cuis-dev wrote:
>
>> Hi,
>>
>> Today I read trough the Layout Tour from the Learning-Cuis 
>> repository. (Meanwhile I created new screenshots for the tutorial and 
>> Ken already merged my pull request.) And also watched Nicolas's video 
>> tutorial on Youtube. (How to compose morphs in layouts in Cuis 
>> Smalltalk)  My experience and you can see in the video also that 
>> sometimes the layout morph doesn't align its submorphs if 
>> proportionalHeight:/proportionalWidth:/offAxisEdgeWeight: are 
>> changed. Nicola uses the halo's resize button to nudge the layout to 
>> do its job. But what is the right message to do this programmatically?
>>
>> The redrawNeeded message is not enough. The LayoutSpecEditPanel from 
>> the Layout Tour uses the layoutSubmorphs message alongside 
>> redrawNeeded in the updateMasterFromCopy method.
>>
>>> myLayoutMorph layoutSubmorphs; redrawNeeded
>>
>> What is the difference between the two method?
>>
>> Regards,
>> Szabolcs

#redrawNeeded means that the morph pixels are no longer valid for some 
reason, so Morphic needs to call its #drawOn: method again to redraw it. 
This method applies to _any_ morph and doesn't handle any specifics of 
particular morphs. Just the fact that a refresh of the pixels is needed.

#layoutSubmorphs is specific for LayoutMorphs (or any other morph that 
positions and resizes its submorphs), and it means that for whatever 
reason submorph layout needs to be recomputed prior to next #drawOn:
.
HTH,

-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich



More information about the Cuis-dev mailing list