How force accepting text in {pluggable}textmorph - and then check it was all ok?

Doug Way dway at riskmetrics.com
Thu Mar 28 23:37:35 UTC 2002


Tim Rowledge wrote:
> 
> I'd like to make VMMakerTool force an accept for the text in the three writable
> morphs anytime one of the generateFoo buttons is pressed. Since any one of them
> might raise a signal to warn of problems, the individual accept methods already
> have exception handlers which work ok.
> 
> My current problem is that even after keeping track of the three morphs and
> sending each one #accept (which properly raises and handles the exceptions I
> expect) I can't see any way to tell if everything is ok or not. Is there any
> message I can send to ask a text morph if it is displaying the same as it is
> holding internally?

If it's a PluggableTextMorph, I think #hasUnacceptedEdits will tell you this.  If it's a plain TextMorph, hmmm... I thought TextMorphs were always in sync with the paragraph editor, but I'm not sure.  If not, maybe adding a method which tests if "text = paragraph text" might do it.

- Doug Way
  dway at riskmetrics.com



More information about the Squeak-dev mailing list