[Pharo-project] RFC: PluggableTextMorphWithLimits

Benjamin benjamin.vanryseghem.pharo at gmail.com
Wed May 4 07:14:15 EDT 2011


In fact, I ant to know if the limit is negative or not because if it's, so it just act like a classic PluggableTextMorph ( if the same text morph is used to display source code and comments, you do not want to restrict comment size ).

But I could use a boolean instead, it was just a first release to know if the concept is cool enough to be used :)


Thanks for your feedback :)


Ben

On May 4, 2011, at 1:05 PM, Fernando Olivero wrote:

> Hi Ben, its a cool idea. To use this physiological "stress factor" to
> force developers to stop coding really long method.
> 
> I looked at the class, i only disliked the statement
> 
> self warningLimit negative ifTrue:[ ^ self basicColor].
> 
> you could do :
> warningLimit: aNumber
>   warningLimit := aNumber max: 0.
> 
> Fernando
> 
> On Wed, May 4, 2011 at 11:18 AM, Benjamin
> <benjamin.vanryseghem.pharo at gmail.com> wrote:
>> Hello Smalltalkers,
>> 
>> I'm currently working on new code editing tools, and I've implemented a new subclass of PluggableTextMorph named PluggableTextMorphWithLimits , with a code oriented feature:
>> 
>> You have a warningLimit ( 350 by default ) and an alertLimit ( 2* warningLimit by default ), and the number of characters of the text displayed is counted ( without space, tabs, cr etc).
>> 
>> If you are below the warning limit, the background is white ( or the default color ), if you are between warningLimit and alertLimit, the background turn more and more yellow, and if you are above the alertLimit, the background turn orange :)
>> 
>> After using it for ten minutes, you start shivering when the background turn yellow ;)
>> 
>>        Gofer new
>>                squeaksource: 'Nautilus';
>>                package: 'PluggableTextMorphWithLimits';
>>                load.
>> 
>> You can test it by evaluating:
>> 
>> PluggableTextMorphWithLimits example.
>> 
>> I think it will be used by Nautilus, but maybe more code editing tools should used it.
>> 
>> 
>> Thanks in advance for your feedback :)
>> 
>> 
>> 
>> Ben
>> 
> 





More information about the Pharo-dev mailing list