Implementors of initWithContents:font:emphasis:

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

Implementors of initWithContents:font:emphasis:

Dan Norton
Greetings,

The following implement #initWithContents:font:emphasis: identically:

MinimalStringMorph
OneLineEditorMorph
StringMorph

and they all inherit from:

    Morph
        RectangleLikeMorph

So, refactoring seems to be in order, maybe by pulling #initWithContents:font:emphasis: up
into Morph. What do you think?

 - Dan

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Implementors of initWithContents:font:emphasis:

Hannes Hirzel
Hi Dan

No. The three morphs you mention all have instance variables

   font emphasis

whereas the sibling morphs do not have these variables neither does Morph.

So the reason of not doing it is that we do not want these instance
variables to be in the other Morphs where they are not used.

--Hannes


On 9/8/15, Dan Norton <[hidden email]> wrote:

> Greetings,
>
> The following implement #initWithContents:font:emphasis: identically:
>
> MinimalStringMorph
> OneLineEditorMorph
> StringMorph
>
> and they all inherit from:
>
>     Morph
>         RectangleLikeMorph
>
> So, refactoring seems to be in order, maybe by pulling
> #initWithContents:font:emphasis: up
> into Morph. What do you think?
>
>  - Dan
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Implementors of initWithContents:font:emphasis:

Dan Norton
Hi Hannes,

I get it. There are lots of sibling morphs. RectangleMorph doesn't need font or emphasis for sure.

And, adding a class to the hierarchy simply to contain the method would not be desirable either.

Geez who came up with this idea, anyway?

 - Dan

On 8 Sep 2015 at 19:24, H. Hirzel wrote:

> Hi Dan
>
> No. The three morphs you mention all have instance variables
>
>    font emphasis
>
> whereas the sibling morphs do not have these variables neither does
> Morph.
>
> So the reason of not doing it is that we do not want these
> instance
> variables to be in the other Morphs where they are not used.
>
> --Hannes
>
>
> On 9/8/15, Dan Norton <[hidden email]> wrote:
> > Greetings,
> >
> > The following implement #initWithContents:font:emphasis:
> identically:
> >
> > MinimalStringMorph
> > OneLineEditorMorph
> > StringMorph
> >
> > and they all inherit from:
> >
> >     Morph
> >         RectangleLikeMorph
> >
> > So, refactoring seems to be in order, maybe by pulling
> > #initWithContents:font:emphasis: up
> > into Morph. What do you think?
> >
> >  - Dan
> >
> > _______________________________________________
> > Cuis mailing list
> > http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
> >
>
> _______________________________________________
> Cuis mailing list
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org

  

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org