Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001431 [Squeak] Morphic minor always 07-08-05 00:47 07-08-05 00:48
Reporter masm View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 3.8
Summary 0001431: [BUG] Embedded TextMorph autoFill with empty text problem!
Description "John R. Pierce" <>:

Hi all,

I uncovered a problem with TextMorph's that are embedded in Morphs with the
autofill property turned on. It seems to exhibit itself in both 3.6 and 3.7.

Basically, if the underlying text of the TextMorph gets set to an empty string,
then when the user starts typing in an empty TextMorph, the new text will not
get shown until a layoutChanged is called (and subsequent repaint cycle).

It appears TextMorph>>updateFromParagraph does call layoutChanged, but that call
doesn't seem to help. Attached is a little bit of code to see the problem:

  morph := Morph new.
  morph extent: 100 @ 20.
  text := TextMorph new.
  morph addMorph: text.
    color: Color white;
    contents: ''.
  morph openInWorld.

  "Now go try to type in the TextMorph and see what I mean"

  "Then run the following code to get the TextMorph to re-display the new text"
  text layoutChanged.
  morph invalidRect: morph bounds. "This is only necessary on 3.6"

If you use a larger embedding morph then the one I had in my sample, you will
actually see the new text showing up on the second line of the morph. This may
be a clue as to what is going on.

Lastly, I noticed this can be fixed by hacking updateFromParagraph and adding an
"ActiveWorld doOneCycle" call right after the call to "self fit" (near the top
of the method).


Additional Information Problem still present in in 3.8-6665
Attached Files

- Relationships

- Notes
(0001718 - 572 - 911 - 1003 - 1003 - 1003 - 1003)
07-08-05 00:48

Yeah, when I did the NCDisplayTextMorph for Connectors I ended up doing
something roughly like this (but only when autoFit and no wrap)
(lifted from the StringMorphEditor):

    | priorEditor |
    super updateFromParagraph.
    priorEditor := editor. "Save editor state"
    self releaseParagraph. "Release paragraph so it will grow with selection."
    self paragraph. "Re-instantiate to set new bounds"
        ifNotNil: [self installEditorToReplace: priorEditor].
    self editor

Ned Konz [^]

- Issue History
Date Modified Username Field Change
07-08-05 00:47 masm New Issue
07-08-05 00:48 masm Note Added: 0001718

Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
31 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker