Q: Updating TextMorph when embedded morph change size?
Karl Ramberg
karl.ramberg at chello.se
Mon Mar 11 09:56:52 UTC 2002
Daniel Joyce wrote:
>
> > I tested the code but it does not help, because I resize the embedded
> > morph
> > within the text. You can test by creating a TextMorph and turn on
> > accepts drops
> > and drop a morph on the text, then resize the dropped morph with the
> > yellow handle.
> > Seems like textmorph must be told to look at it's submorphs and whether
> > any of them
> > has changed.
> >
> > Karl
>
> Well, don't child morphs send layoutchanged to parents when they change
> sizes?
>
> Really, the morphs should send layout changed all the way up to the
> worldview, so all parents in a chain can adapt if need be. I know some
> morphs don't relay this on as needed.
>
> If so, perhaps TextMorph is not listening properly..
>
> Daniel
That's exactly the problem, and looking at layoutChanged I see
TextMorph>> layoutChanged
"self releaseParagraph."
super layoutChanged
Uncommenting the self realeaseParagraph give me what I want but also
makes some unwanted behavior in the image, like walkbacks when opening
inspectors etc.
So sending releaseParagraph and then layoutChanged to the TextMorph
seems to
solve my most immediate problems.
Karl
More information about the Squeak-dev
mailing list
|