[Cuis-dev] initial size of SystemWindow subclass

Juan Vuletich juan at cuis.st
Mon Aug 12 06:18:25 PDT 2024


On 8/10/2024 5:32 PM, Mark Volkmann via Cuis-dev wrote:
> On Sat, Aug 10, 2024 at 12:22 PM <ken.dickey at whidbey.com 
> <mailto:ken.dickey at whidbey.com>> wrote:
>
>     On 2024-08-10 08:23, Mark Volkmann via Cuis-dev wrote:
>
>     > I am calling openInWorld after creating my morph where all
>     submorphs
>     > are added to it in its initialize method. Is there something I
>     need to
>     > do to tell my morph to "pack" its submorphs?
>
>     Note implementers of #layoutSubmorphs.  Morph is different than, say,
>     SystemWindow or LayoutMorph.  What does the code say?
>
>
> Let's take a very simple example:
>
> window := SystemWindow new.
> window addMorph: (LabelMorph new contents: 'Hello World').
> window layoutSubmorphs.
> window openInWorld.
>
> The window will be much larger than what is required to hold the 
> LabelMorph.
> Sending #layoutSubmorphs doesn't seem to affect the window size in 
> this case.
> What can I do to tell the SystemWindow that I want its extent to be 
> the minimum required to display its submorphs.
> Side note: I have spent hours digging through the source code trying 
> to figure it out on my own.

Yes. And as you grow your Smalltalk-fu you'll become more and more 
effective at this. This is the real power of Smalltalk.

> -- 
> R. Mark Volkmann
> Object Computing, Inc.

Cheers,

-- 
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

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


More information about the Cuis-dev mailing list