Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Radioactive cats have 18 half-lives.


devel / comp.lang.smalltalk.dolphin / How to manage layout of overlapping views

SubjectAuthor
* How to manage layout of overlapping viewsJoe Betz
`- Re: How to manage layout of overlapping viewsJoe Betz

1
How to manage layout of overlapping views

<4a09bcc0-2221-41c1-9d19-c573a93dbf11n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9991&group=comp.lang.smalltalk.dolphin#9991

  copy link   Newsgroups: comp.lang.smalltalk.dolphin
X-Received: by 2002:ac8:5712:: with SMTP id 18mr8680836qtw.584.1639907831856;
Sun, 19 Dec 2021 01:57:11 -0800 (PST)
X-Received: by 2002:a05:6830:1cf:: with SMTP id r15mr7706879ota.320.1639907831528;
Sun, 19 Dec 2021 01:57:11 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.smalltalk.dolphin
Date: Sun, 19 Dec 2021 01:57:11 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=5.48.59.174; posting-account=P1X3VgoAAADgSty0b3mKYJl_KPjmW842
NNTP-Posting-Host: 5.48.59.174
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4a09bcc0-2221-41c1-9d19-c573a93dbf11n@googlegroups.com>
Subject: How to manage layout of overlapping views
From: joebet...@gmail.com (Joe Betz)
Injection-Date: Sun, 19 Dec 2021 09:57:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 37
 by: Joe Betz - Sun, 19 Dec 2021 09:57 UTC

What's the correct layout to use if you want multiple subviews to take up 100% of the height and width of their parent?

I tried using FramingLayout on the parent view, then set all of the framing constraints both the model and menu views to the corresponding #fixedParentX, but it didn't work. The model view somehow ends up being way bigger than the shell, to the point that I can't even resize the window to see everything in it.
Is there a way to achieve what I want using the FramingLayout? And if not, what is the right way to handle this sort of relationship between views? Do I need to do something more complicated like the ScrollingDecorator?

The reason I need this is that the top-level shell view of my application has two subviews, one for the model and another for a menu. The menu is opened with a modifier key and overlayed on top of the model view by calling `zOrderTop` and then calls `zOrderBottom` when it closes. And that part works great, there's no flicker whatsoever. But the layout is borked.

model: anObject
super model: anObject.
self layoutManager: FramingLayout new.
menuView := self addSubView: Menu new.
menuView model: nil.
menuView arrangement
leftFraming: #fixedParentLeft;
rightFraming: #fixedParentRight;
topFraming: #fixedParentTop;
bottomFraming: #fixedParentBottom.
modelView := self addSubView: ModelView new.
modelView model: anObject.
modelView arrangement
leftFraming: #fixedParentLeft;
rightFraming: #fixedParentRight;
topFraming: #fixedParentTop;
bottomFraming: #fixedParentBottom

Re: How to manage layout of overlapping views

<96c100bd-379d-4817-bc6f-bce67965d5c8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9992&group=comp.lang.smalltalk.dolphin#9992

  copy link   Newsgroups: comp.lang.smalltalk.dolphin
X-Received: by 2002:a05:6214:27c4:: with SMTP id ge4mr4625464qvb.39.1639910042006;
Sun, 19 Dec 2021 02:34:02 -0800 (PST)
X-Received: by 2002:a4a:85cf:: with SMTP id u15mr7169986ooh.45.1639910041680;
Sun, 19 Dec 2021 02:34:01 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.smalltalk.dolphin
Date: Sun, 19 Dec 2021 02:34:01 -0800 (PST)
In-Reply-To: <4a09bcc0-2221-41c1-9d19-c573a93dbf11n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.48.59.174; posting-account=P1X3VgoAAADgSty0b3mKYJl_KPjmW842
NNTP-Posting-Host: 5.48.59.174
References: <4a09bcc0-2221-41c1-9d19-c573a93dbf11n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <96c100bd-379d-4817-bc6f-bce67965d5c8n@googlegroups.com>
Subject: Re: How to manage layout of overlapping views
From: joebet...@gmail.com (Joe Betz)
Injection-Date: Sun, 19 Dec 2021 10:34:01 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 57
 by: Joe Betz - Sun, 19 Dec 2021 10:34 UTC

Okay, I inspected the FramingConstraints on the actual view and that revealed the problem. For whatever reason, the right and bottom offsets were non-zero. If I set them all to zero immediately after calling the framing method then it works correctly.

modelView arrangement
leftFraming: #fixedParentLeft; leftOffset: 0;
rightFraming: #fixedParentRight; rightOffset: 0;
topFraming: #fixedParentTop; topOffset: 0;
bottomFraming: #fixedParentBottom; bottomOffset: 0

Anyone know why this is necessary? `FramingConstraints>>initialize` initializes all the offsets to 0 so they must be getting mucked with dynamically.

On Sunday, December 19, 2021 at 10:57:12 AM UTC+1, Joe Betz wrote:
> What's the correct layout to use if you want multiple subviews to take up 100% of the height and width of their parent?
>
> I tried using FramingLayout on the parent view, then set all of the framing constraints both the model and menu views to the corresponding #fixedParentX, but it didn't work. The model view somehow ends up being way bigger than the shell, to the point that I can't even resize the window to see everything in it.
>
> Is there a way to achieve what I want using the FramingLayout? And if not, what is the right way to handle this sort of relationship between views? Do I need to do something more complicated like the ScrollingDecorator?
>
> The reason I need this is that the top-level shell view of my application has two subviews, one for the model and another for a menu. The menu is opened with a modifier key and overlayed on top of the model view by calling `zOrderTop` and then calls `zOrderBottom` when it closes. And that part works great, there's no flicker whatsoever. But the layout is borked.
>
>
>
> model: anObject
> super model: anObject.
> self layoutManager: FramingLayout new.
> menuView := self addSubView: Menu new.
> menuView model: nil.
> menuView arrangement
> leftFraming: #fixedParentLeft;
> rightFraming: #fixedParentRight;
> topFraming: #fixedParentTop;
> bottomFraming: #fixedParentBottom.
> modelView := self addSubView: ModelView new.
> modelView model: anObject.
> modelView arrangement
> leftFraming: #fixedParentLeft;
> rightFraming: #fixedParentRight;
> topFraming: #fixedParentTop;
> bottomFraming: #fixedParentBottom

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor