[Cuis-dev] initial size of SystemWindow subclass

Mark Volkmann r.mark.volkmann at gmail.com
Sat Aug 10 13:32:36 PDT 2024


On Sat, Aug 10, 2024 at 12:22 PM <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.

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240810/670e0723/attachment.htm>


More information about the Cuis-dev mailing list