NewTextMorph authoringPrototype

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

NewTextMorph authoringPrototype

Tudor Girba
Hi,

I was looking for examples of how to use NewTextMorph, and I tried:

NewTextMorph authoringPrototype

However, it raises errors which seem to be related to an initialization problem. Am I doing something wrong, or is it simply a bug?

Cheers,
Doru

--
www.tudorgirba.com

"Not knowing how to do something is not an argument for how it cannot be done."


Reply | Threaded
Open this post in threaded view
|

Re: NewTextMorph authoringPrototype

Stéphane Ducasse
doru authoringPrototype looks to me like deprecated.
and may be it was reintroduced when we loaded it back.

Stef

On Dec 11, 2010, at 6:26 PM, Tudor Girba wrote:

> Hi,
>
> I was looking for examples of how to use NewTextMorph, and I tried:
>
> NewTextMorph authoringPrototype
>
> However, it raises errors which seem to be related to an initialization problem. Am I doing something wrong, or is it simply a bug?
>
> Cheers,
> Doru
>
> --
> www.tudorgirba.com
>
> "Not knowing how to do something is not an argument for how it cannot be done."
>
>


Reply | Threaded
Open this post in threaded view
|

Re: NewTextMorph authoringPrototype

Tudor Girba
Hi,

Ok, but the problem appears also with a simple NewTextMorph:
        | t |
        t := NewTextMorph new.
        t openInWorld .

Cheers,
Doru


On 11 Dec 2010, at 18:30, Stéphane Ducasse wrote:

> doru authoringPrototype looks to me like deprecated.
> and may be it was reintroduced when we loaded it back.
>
> Stef
>
> On Dec 11, 2010, at 6:26 PM, Tudor Girba wrote:
>
>> Hi,
>>
>> I was looking for examples of how to use NewTextMorph, and I tried:
>>
>> NewTextMorph authoringPrototype
>>
>> However, it raises errors which seem to be related to an initialization problem. Am I doing something wrong, or is it simply a bug?
>>
>> Cheers,
>> Doru
>>
>> --
>> www.tudorgirba.com
>>
>> "Not knowing how to do something is not an argument for how it cannot be done."
>>
>>
>
>

--
www.tudorgirba.com

"Problem solving should be focused on describing
the problem in a way that makes the solution obvious."





Reply | Threaded
Open this post in threaded view
|

Re: NewTextMorph authoringPrototype

Igor Stasenko
The #changeParagraph: is bogus:

changeParagraph: aParagraph
        "Install aParagraph as the one to be edited by the receiver."

        self resetState

TextEditor>>paragraph is following:
paragraph
        ^ morph
                ifNotNil: [morph paragraph]


I changed the TextEditor, for creating and initializing it not like:
TextEditor new
but like:
TextEditor newForMorph: morph

in that way, TextEditor>>paragraph always works.
And for same reason, i removed the #changeParagraph: ,
because it useless.

Also, the following test is now should be rewritten:

CompilerEvaluationTest>>testEvaluationOfSelfSend
SmalltalkEditorTest >> testCompilationOfUndefinedVar

they using old SmalltalkEditor new, instead of (newForMorph:)
as well as using #changeParagraph:

So, creating SmalltalkEditor can be done like:

morph := NewTextMorph new.
morph paragraph: paragraph.
editor := SmalltalkEditor newForMorph: morph.


--
Best regards,
Igor Stasenko AKA sig.

NewTextMorph-TextEditor-fixes.1.cs (2K) Download Attachment