Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

A programming language is low level when its programs require attention to the irrelevant.


programming / comp.lang.smalltalk.dolphin / Re: Auto-expanding a MultilineTextEdit

SubjectAuthor
* Auto-expanding a MultilineTextEditJoe Betz
`- Re: Auto-expanding a MultilineTextEditJoe Betz

1
Subject: Auto-expanding a MultilineTextEdit
From: Joe Betz
Newsgroups: comp.lang.smalltalk.dolphin
Date: Tue, 22 Feb 2022 21:51 UTC
X-Received: by 2002:a5d:668e:0:b0:1e3:312f:3848 with SMTP id l14-20020a5d668e000000b001e3312f3848mr20556779wru.288.1645566675106;
Tue, 22 Feb 2022 13:51:15 -0800 (PST)
X-Received: by 2002:aca:3787:0:b0:2cb:676a:47ed with SMTP id
e129-20020aca3787000000b002cb676a47edmr2908600oia.76.1645566674400; Tue, 22
Feb 2022 13:51:14 -0800 (PST)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.smalltalk.dolphin
Date: Tue, 22 Feb 2022 13:51:14 -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: <022ae86b-eb43-40f8-b24f-349d65b2718fn@googlegroups.com>
Subject: Auto-expanding a MultilineTextEdit
From: joebet...@gmail.com (Joe Betz)
Injection-Date: Tue, 22 Feb 2022 21:51:15 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
View all headers
How do you configure a MultilineTextEdit to increase in height whenever text wraps to a new line or a newline gets added (i.e., by pressing enter)?

Context: The MultilineTextEdit is inside a ContainerView using ProportionalLayout with arrangement set to 0. I tried enabling `usePreferredExtent`, recalculating the extent with every key typed, and then updating it using `preferredExtent:`, but the edit field remains the same size.

I have a strong feeling that it's an issue with the layouts but I can't figure out a better way to arrange things to get the behavior I want.


Subject: Re: Auto-expanding a MultilineTextEdit
From: Joe Betz
Newsgroups: comp.lang.smalltalk.dolphin
Date: Sat, 26 Feb 2022 07:13 UTC
References: 1
X-Received: by 2002:a05:622a:283:b0:2de:b3a2:b52d with SMTP id z3-20020a05622a028300b002deb3a2b52dmr6169406qtw.625.1645859595182;
Fri, 25 Feb 2022 23:13:15 -0800 (PST)
X-Received: by 2002:a05:6808:d4a:b0:2d7:2e0a:bfa4 with SMTP id
w10-20020a0568080d4a00b002d72e0abfa4mr4095098oik.131.1645859594858; Fri, 25
Feb 2022 23:13:14 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!1.us.feeder.erje.net!feeder.erje.net!border1.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: Fri, 25 Feb 2022 23:13:14 -0800 (PST)
In-Reply-To: <022ae86b-eb43-40f8-b24f-349d65b2718fn@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: <022ae86b-eb43-40f8-b24f-349d65b2718fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c893fe6f-d382-4e29-bd47-a441f15d5895n@googlegroups.com>
Subject: Re: Auto-expanding a MultilineTextEdit
From: joebet...@gmail.com (Joe Betz)
Injection-Date: Sat, 26 Feb 2022 07:13:15 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 5
View all headers
<sigh> There was an extra ContainerView that was screwing things up, inbetween the input field and the view where the layout was correctly defined. Got rid of that and `preferredExtent:` is now working as expected.

onKeyTyped: aKeyEvent on: aTextInput
| newExtent |
newExtent := aTextInput calculateExtent: (LayoutContext forContainer: self).
(newExtent y < 250) ifTrue: [ aTextInput preferredExtent: newExtent ]


1
rocksolid light 0.7.2
clearneti2ptor