default styler is shout

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

default styler is shout

Tudor Girba
Hi,

In the latest Morphic version, the default styler of the PluggableTextMorph is given by:
useDefaultStyler
        "This should be changed to a proper registry but as long as there is only shout this will do"

        Smalltalk globals
                at: #SHTextStylerST80
                ifPresent: [ :stylerClass | self styler: (stylerClass new view: self) ]
                ifAbsent: [ self styler: ( NullTextStyler new view: self) ]

Thus, if Shout is loaded, you will get it in all text morphs by default. Given that TextMorph should be general and be used in all sorts of contexts, the default behavior should be the original:

useDefaultStyler
        "This should be changed to a proper registry but as long as there is only shout this will do"

        self styler: (NullTextStyler new view: self; yourself).


What do you say?

Cheers,
Doru

--
www.tudorgirba.com

"We are all great at making mistakes."








Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Guillermo Polito
Why not delegate it in the used Editor ?  SmalltalkEditor should use shout while the other editors should use the NullTextStyler.  Maybe something like this:

PluggableTextMorph>>useDefaultStyler
    self styler: textMorph editor styler

Or better:

PluggableTextMorph>>useDefaultStyler
    self styler: textMorph styler

And then

Editor>>styler


On Sat, Jan 22, 2011 at 12:25 PM, Tudor Girba <[hidden email]> wrote:
Hi,

In the latest Morphic version, the default styler of the PluggableTextMorph is given by:
useDefaultStyler
       "This should be changed to a proper registry but as long as there is only shout this will do"

       Smalltalk globals
               at: #SHTextStylerST80
               ifPresent: [ :stylerClass | self styler: (stylerClass new view: self) ]
               ifAbsent: [ self styler: ( NullTextStyler new view: self) ]

Thus, if Shout is loaded, you will get it in all text morphs by default. Given that TextMorph should be general and be used in all sorts of contexts, the default behavior should be the original:

useDefaultStyler
       "This should be changed to a proper registry but as long as there is only shout this will do"

       self styler: (NullTextStyler new view: self; yourself).


What do you say?

Cheers,
Doru

--
www.tudorgirba.com

"We are all great at making mistakes."









Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Guillermo Polito
Ufa,...

Editor>>styler
  ^NullTextStyler new

SmalltalkEditor>>styler
  ^...

Guille

On Sat, Jan 22, 2011 at 10:54 PM, Guillermo Polito <[hidden email]> wrote:
Why not delegate it in the used Editor ?  SmalltalkEditor should use shout while the other editors should use the NullTextStyler.  Maybe something like this:

PluggableTextMorph>>useDefaultStyler
    self styler: textMorph editor styler

Or better:

PluggableTextMorph>>useDefaultStyler
    self styler: textMorph styler

And then

Editor>>styler



On Sat, Jan 22, 2011 at 12:25 PM, Tudor Girba <[hidden email]> wrote:
Hi,

In the latest Morphic version, the default styler of the PluggableTextMorph is given by:
useDefaultStyler
       "This should be changed to a proper registry but as long as there is only shout this will do"

       Smalltalk globals
               at: #SHTextStylerST80
               ifPresent: [ :stylerClass | self styler: (stylerClass new view: self) ]
               ifAbsent: [ self styler: ( NullTextStyler new view: self) ]

Thus, if Shout is loaded, you will get it in all text morphs by default. Given that TextMorph should be general and be used in all sorts of contexts, the default behavior should be the original:

useDefaultStyler
       "This should be changed to a proper registry but as long as there is only shout this will do"

       self styler: (NullTextStyler new view: self; yourself).


What do you say?

Cheers,
Doru

--
www.tudorgirba.com

"We are all great at making mistakes."










Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Guillermo Polito
Anyways, I'm looking that

PluggableTextMorph>>textMorphClass
    "Answer the class used to create the receiver's textMorph"
   
    ^TextMorphForEditView

and

TextMorphForEditView>>editorClass
    ^ SmalltalkEditor


So it's what I suggested needs a lot of work more...

On Sat, Jan 22, 2011 at 10:58 PM, Guillermo Polito <[hidden email]> wrote:
Ufa,...

Editor>>styler
  ^NullTextStyler new

SmalltalkEditor>>styler
  ^...

Guille


On Sat, Jan 22, 2011 at 10:54 PM, Guillermo Polito <[hidden email]> wrote:
Why not delegate it in the used Editor ?  SmalltalkEditor should use shout while the other editors should use the NullTextStyler.  Maybe something like this:

PluggableTextMorph>>useDefaultStyler
    self styler: textMorph editor styler

Or better:

PluggableTextMorph>>useDefaultStyler
    self styler: textMorph styler

And then

Editor>>styler



On Sat, Jan 22, 2011 at 12:25 PM, Tudor Girba <[hidden email]> wrote:
Hi,

In the latest Morphic version, the default styler of the PluggableTextMorph is given by:
useDefaultStyler
       "This should be changed to a proper registry but as long as there is only shout this will do"

       Smalltalk globals
               at: #SHTextStylerST80
               ifPresent: [ :stylerClass | self styler: (stylerClass new view: self) ]
               ifAbsent: [ self styler: ( NullTextStyler new view: self) ]

Thus, if Shout is loaded, you will get it in all text morphs by default. Given that TextMorph should be general and be used in all sorts of contexts, the default behavior should be the original:

useDefaultStyler
       "This should be changed to a proper registry but as long as there is only shout this will do"

       self styler: (NullTextStyler new view: self; yourself).


What do you say?

Cheers,
Doru

--
www.tudorgirba.com

"We are all great at making mistakes."











Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Stéphane Ducasse
In reply to this post by Tudor Girba
This seems ok for me.
When others reply open a  ticket + changes and we will integrate that.

On Jan 22, 2011, at 4:25 PM, Tudor Girba wrote:

> Hi,
>
> In the latest Morphic version, the default styler of the PluggableTextMorph is given by:
> useDefaultStyler
>        "This should be changed to a proper registry but as long as there is only shout this will do"
>
>        Smalltalk globals
>                at: #SHTextStylerST80
>                ifPresent: [ :stylerClass | self styler: (stylerClass new view: self) ]
>                ifAbsent: [ self styler: ( NullTextStyler new view: self) ]
>
> Thus, if Shout is loaded, you will get it in all text morphs by default. Given that TextMorph should be general and be used in all sorts of contexts, the default behavior should be the original:
>
> useDefaultStyler
> "This should be changed to a proper registry but as long as there is only shout this will do"
>
> self styler: (NullTextStyler new view: self; yourself).
>
>
> What do you say?
>
> Cheers,
> Doru
>
> --
> www.tudorgirba.com
>
> "We are all great at making mistakes."
>
>
>
>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Marcus Denker-4
In reply to this post by Tudor Girba
Hi,

We need the imperfect, intermediate solution that is good enough for people to live with
in 1.2.

On Jan 22, 2011, at 4:25 PM, Tudor Girba wrote:

> Hi,
>
> In the latest Morphic version, the default styler of the PluggableTextMorph is given by:
> useDefaultStyler
>        "This should be changed to a proper registry but as long as there is only shout this will do"
>
>        Smalltalk globals
>                at: #SHTextStylerST80
>                ifPresent: [ :stylerClass | self styler: (stylerClass new view: self) ]
>                ifAbsent: [ self styler: ( NullTextStyler new view: self) ]
>
> Thus, if Shout is loaded, you will get it in all text morphs by default. Given that TextMorph should be general and be used in all sorts of contexts, the default behavior should be the original:
>
> useDefaultStyler
> "This should be changed to a proper registry but as long as there is only shout this will do"
>
> self styler: (NullTextStyler new view: self; yourself).
>
>
> What do you say?
>
> Cheers,
> Doru
>
> --
> www.tudorgirba.com
>
> "We are all great at making mistakes."
>
>
>
>
>
>
>
>

--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.


Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Mariano Martinez Peck
I think Tudor is right. We cannot have shout everywhere by default. Take an example. Today morning, I opened the latest PharoDev and I couldn't understand why my nice welcome workspace was converted to an ugly red text workspace, like if it was code, which was not, of course. Now I read this email and I think it is related.

Take a look to the PharoDev image from hudson and you will see what I am talking about.

+1 not having Shout for everybody and instead, have the previous behavior. Of course I have no idea how to do it because otherwise I would have done it.

Now, if we change to what Doru says, so I think some senders have to be updated if they would expect to have shout as the default. For example, FinderUI. I guess it would like to use the default/null styler in a PharoCore image, but in presence of Shout, it would probably like to use shout styler. But in such case, maybe he can use #styler:   rather that #setDefaultStyler  ?

cheers

mariano

On Sun, Jan 23, 2011 at 8:47 AM, Marcus Denker <[hidden email]> wrote:
Hi,

We need the imperfect, intermediate solution that is good enough for people to live with
in 1.2.

On Jan 22, 2011, at 4:25 PM, Tudor Girba wrote:

> Hi,
>
> In the latest Morphic version, the default styler of the PluggableTextMorph is given by:
> useDefaultStyler
>        "This should be changed to a proper registry but as long as there is only shout this will do"
>
>        Smalltalk globals
>                at: #SHTextStylerST80
>                ifPresent: [ :stylerClass | self styler: (stylerClass new view: self) ]
>                ifAbsent: [ self styler: ( NullTextStyler new view: self) ]
>
> Thus, if Shout is loaded, you will get it in all text morphs by default. Given that TextMorph should be general and be used in all sorts of contexts, the default behavior should be the original:
>
> useDefaultStyler
>       "This should be changed to a proper registry but as long as there is only shout this will do"
>
>       self styler: (NullTextStyler new view: self; yourself).
>
>
> What do you say?
>
> Cheers,
> Doru
>
> --
> www.tudorgirba.com
>
> "We are all great at making mistakes."
>
>
>
>
>
>
>
>

--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.



Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Guillermo Polito
In reply to this post by Marcus Denker-4
But that imperfect solution won't be a good solution either, since we are not going to have shout styler anywhere :).

On Sun, Jan 23, 2011 at 4:47 AM, Marcus Denker <[hidden email]> wrote:
Hi,

We need the imperfect, intermediate solution that is good enough for people to live with
in 1.2.

On Jan 22, 2011, at 4:25 PM, Tudor Girba wrote:

> Hi,
>
> In the latest Morphic version, the default styler of the PluggableTextMorph is given by:
> useDefaultStyler
>        "This should be changed to a proper registry but as long as there is only shout this will do"
>
>        Smalltalk globals
>                at: #SHTextStylerST80
>                ifPresent: [ :stylerClass | self styler: (stylerClass new view: self) ]
>                ifAbsent: [ self styler: ( NullTextStyler new view: self) ]
>
> Thus, if Shout is loaded, you will get it in all text morphs by default. Given that TextMorph should be general and be used in all sorts of contexts, the default behavior should be the original:
>
> useDefaultStyler
>       "This should be changed to a proper registry but as long as there is only shout this will do"
>
>       self styler: (NullTextStyler new view: self; yourself).
>
>
> What do you say?
>
> Cheers,
> Doru
>
> --
> www.tudorgirba.com
>
> "We are all great at making mistakes."
>
>
>
>
>
>
>
>

--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.



Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Marcus Denker-4
In reply to this post by Marcus Denker-4

On Jan 24, 2011, at 2:19 AM, Guillermo Polito wrote:

But that imperfect solution won't be a good solution either, since we are not going to have shout styler anywhere :).


So how is that solved in1.1?  We need, for 1.2, just a *usable* compromise. Then we can iterate in 1.3

Marcus


--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.

Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Tudor Girba
Hi,

I opened a ticket. We should move the discussion there:
http://code.google.com/p/pharo/issues/detail?id=3583

Cheers,
Doru

On 24 Jan 2011, at 08:31, Marcus Denker wrote:

>
> On Jan 24, 2011, at 2:19 AM, Guillermo Polito wrote:
>
>> But that imperfect solution won't be a good solution either, since we are not going to have shout styler anywhere :).
>>
>
> So how is that solved in1.1?  We need, for 1.2, just a *usable* compromise. Then we can iterate in 1.3
>
> Marcus
>
>
> --
> Marcus Denker  -- http://www.marcusdenker.de
> INRIA Lille -- Nord Europe. Team RMoD.
>

--
www.tudorgirba.com

"In a world where everything is moving ever faster,
one might have better chances to win by moving slower."




Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Lukas Renggli
Just as an additional comment (don't know if this is related or not):

For OB I had to subclass Editor and duplicate all SmalltalkEditor
functionality, because the same Morph instance is used different
contexts. Previously it was very easy to enable and disable syntax
highlighting and other Smalltalk specific functionality.

Lukas

On 24 January 2011 00:10, Tudor Girba <[hidden email]> wrote:

> Hi,
>
> I opened a ticket. We should move the discussion there:
> http://code.google.com/p/pharo/issues/detail?id=3583
>
> Cheers,
> Doru
>
> On 24 Jan 2011, at 08:31, Marcus Denker wrote:
>
>>
>> On Jan 24, 2011, at 2:19 AM, Guillermo Polito wrote:
>>
>>> But that imperfect solution won't be a good solution either, since we are not going to have shout styler anywhere :).
>>>
>>
>> So how is that solved in1.1?  We need, for 1.2, just a *usable* compromise. Then we can iterate in 1.3
>>
>>       Marcus
>>
>>
>> --
>> Marcus Denker  -- http://www.marcusdenker.de
>> INRIA Lille -- Nord Europe. Team RMoD.
>>
>
> --
> www.tudorgirba.com
>
> "In a world where everything is moving ever faster,
> one might have better chances to win by moving slower."
>
>
>
>
>



--
Lukas Renggli
www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Benjamin Van Ryseghem (Pharo)
I've posted a change this morning when activating styling is just  a message (beStyled) to send to a PluggableTextMorph


Ben

On Jan 24, 2011, at 4:46 PM, Lukas Renggli wrote:

> Just as an additional comment (don't know if this is related or not):
>
> For OB I had to subclass Editor and duplicate all SmalltalkEditor
> functionality, because the same Morph instance is used different
> contexts. Previously it was very easy to enable and disable syntax
> highlighting and other Smalltalk specific functionality.
>
> Lukas
>
> On 24 January 2011 00:10, Tudor Girba <[hidden email]> wrote:
>> Hi,
>>
>> I opened a ticket. We should move the discussion there:
>> http://code.google.com/p/pharo/issues/detail?id=3583
>>
>> Cheers,
>> Doru
>>
>> On 24 Jan 2011, at 08:31, Marcus Denker wrote:
>>
>>>
>>> On Jan 24, 2011, at 2:19 AM, Guillermo Polito wrote:
>>>
>>>> But that imperfect solution won't be a good solution either, since we are not going to have shout styler anywhere :).
>>>>
>>>
>>> So how is that solved in1.1?  We need, for 1.2, just a *usable* compromise. Then we can iterate in 1.3
>>>
>>>       Marcus
>>>
>>>
>>> --
>>> Marcus Denker  -- http://www.marcusdenker.de
>>> INRIA Lille -- Nord Europe. Team RMoD.
>>>
>>
>> --
>> www.tudorgirba.com
>>
>> "In a world where everything is moving ever faster,
>> one might have better chances to win by moving slower."
>>
>>
>>
>>
>>
>
>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>


Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Alain Plantec-4
In reply to this post by Lukas Renggli
Hi Lukas,
When you say "previously" do you mean with
ParagraphEditor or with previous version of
Editor/TextEditor/SmalltalkEditor ?
Cheers
Alain


Le 24/01/2011 16:46, Lukas Renggli a écrit :

> Just as an additional comment (don't know if this is related or not):
>
> For OB I had to subclass Editor and duplicate all SmalltalkEditor
> functionality, because the same Morph instance is used different
> contexts. Previously it was very easy to enable and disable syntax
> highlighting and other Smalltalk specific functionality.
>
> Lukas
>
> On 24 January 2011 00:10, Tudor Girba<[hidden email]>  wrote:
>> Hi,
>>
>> I opened a ticket. We should move the discussion there:
>> http://code.google.com/p/pharo/issues/detail?id=3583
>>
>> Cheers,
>> Doru
>>
>> On 24 Jan 2011, at 08:31, Marcus Denker wrote:
>>
>>> On Jan 24, 2011, at 2:19 AM, Guillermo Polito wrote:
>>>
>>>> But that imperfect solution won't be a good solution either, since we are not going to have shout styler anywhere :).
>>>>
>>> So how is that solved in1.1?  We need, for 1.2, just a *usable* compromise. Then we can iterate in 1.3
>>>
>>>        Marcus
>>>
>>>
>>> --
>>> Marcus Denker  -- http://www.marcusdenker.de
>>> INRIA Lille -- Nord Europe. Team RMoD.
>>>
>> --
>> www.tudorgirba.com
>>
>> "In a world where everything is moving ever faster,
>> one might have better chances to win by moving slower."
>>
>>
>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Lukas Renggli
I mean with the old ParagraphEditor. I am not saying that the old
ParagraphEditor was better (it had lots of other problems), but the
separation between Editor and SmalltalkEditor makes the OB code much
more complicated.

Also having to send #beStyled is kind of tricky. The previous pull
mechanism with #shoutWantsToBeStyled: was much more useful as the
model of the editor could decide itself how and if it wanted to be
styled. Now the model (or some other new entity inbetween) needs to
know the view and update the editor all the time.

Lukas

On 24 January 2011 08:23, Alain Plantec <[hidden email]> wrote:

> Hi Lukas,
> When you say "previously" do you mean with
> ParagraphEditor or with previous version of
> Editor/TextEditor/SmalltalkEditor ?
> Cheers
> Alain
>
>
> Le 24/01/2011 16:46, Lukas Renggli a écrit :
>>
>> Just as an additional comment (don't know if this is related or not):
>>
>> For OB I had to subclass Editor and duplicate all SmalltalkEditor
>> functionality, because the same Morph instance is used different
>> contexts. Previously it was very easy to enable and disable syntax
>> highlighting and other Smalltalk specific functionality.
>>
>> Lukas
>>
>> On 24 January 2011 00:10, Tudor Girba<[hidden email]>  wrote:
>>>
>>> Hi,
>>>
>>> I opened a ticket. We should move the discussion there:
>>> http://code.google.com/p/pharo/issues/detail?id=3583
>>>
>>> Cheers,
>>> Doru
>>>
>>> On 24 Jan 2011, at 08:31, Marcus Denker wrote:
>>>
>>>> On Jan 24, 2011, at 2:19 AM, Guillermo Polito wrote:
>>>>
>>>>> But that imperfect solution won't be a good solution either, since we
>>>>> are not going to have shout styler anywhere :).
>>>>>
>>>> So how is that solved in1.1?  We need, for 1.2, just a *usable*
>>>> compromise. Then we can iterate in 1.3
>>>>
>>>>       Marcus
>>>>
>>>>
>>>> --
>>>> Marcus Denker  -- http://www.marcusdenker.de
>>>> INRIA Lille -- Nord Europe. Team RMoD.
>>>>
>>> --
>>> www.tudorgirba.com
>>>
>>> "In a world where everything is moving ever faster,
>>> one might have better chances to win by moving slower."
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>



--
Lukas Renggli
www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: default styler is shout

Stéphane Ducasse
ok we will have to iterate once more time... :)
Tx for the report lukas.
Stef

On Jan 24, 2011, at 5:37 PM, Lukas Renggli wrote:

> I mean with the old ParagraphEditor. I am not saying that the old
> ParagraphEditor was better (it had lots of other problems), but the
> separation between Editor and SmalltalkEditor makes the OB code much
> more complicated.
>
> Also having to send #beStyled is kind of tricky. The previous pull
> mechanism with #shoutWantsToBeStyled: was much more useful as the
> model of the editor could decide itself how and if it wanted to be
> styled. Now the model (or some other new entity inbetween) needs to
> know the view and update the editor all the time.
>
> Lukas
>
> On 24 January 2011 08:23, Alain Plantec <[hidden email]> wrote:
>> Hi Lukas,
>> When you say "previously" do you mean with
>> ParagraphEditor or with previous version of
>> Editor/TextEditor/SmalltalkEditor ?
>> Cheers
>> Alain
>>
>>
>> Le 24/01/2011 16:46, Lukas Renggli a écrit :
>>>
>>> Just as an additional comment (don't know if this is related or not):
>>>
>>> For OB I had to subclass Editor and duplicate all SmalltalkEditor
>>> functionality, because the same Morph instance is used different
>>> contexts. Previously it was very easy to enable and disable syntax
>>> highlighting and other Smalltalk specific functionality.
>>>
>>> Lukas
>>>
>>> On 24 January 2011 00:10, Tudor Girba<[hidden email]>  wrote:
>>>>
>>>> Hi,
>>>>
>>>> I opened a ticket. We should move the discussion there:
>>>> http://code.google.com/p/pharo/issues/detail?id=3583
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>> On 24 Jan 2011, at 08:31, Marcus Denker wrote:
>>>>
>>>>> On Jan 24, 2011, at 2:19 AM, Guillermo Polito wrote:
>>>>>
>>>>>> But that imperfect solution won't be a good solution either, since we
>>>>>> are not going to have shout styler anywhere :).
>>>>>>
>>>>> So how is that solved in1.1?  We need, for 1.2, just a *usable*
>>>>> compromise. Then we can iterate in 1.3
>>>>>
>>>>>       Marcus
>>>>>
>>>>>
>>>>> --
>>>>> Marcus Denker  -- http://www.marcusdenker.de
>>>>> INRIA Lille -- Nord Europe. Team RMoD.
>>>>>
>>>> --
>>>> www.tudorgirba.com
>>>>
>>>> "In a world where everything is moving ever faster,
>>>> one might have better chances to win by moving slower."
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>