Hi,

Yes, the label does introduce redundancy in some cases, but that is because
the use of printString has to be rethought :)

printString was used for a long time as a primary inspection tool. Because
of that it tries to do too much (like adding the class name), and it is
certainly not suitable for a label.

gtDisplayString is meant for labeling the content of the object. It is used
also for things like a list. As soon as you will do something with your
objects, you will want to have something smaller. There is no need to have
the class part of that string. Relying on that convention is brittle, as it
is easy for people to not have the class name in there. But, for an
inspector, having the class at all times is a prerequisite, so that will be
displayed always separately (to ensure that the right information is
offered).

gtDisplayString relies on printString by default, so people can provide the
labels at their convenience.

Cheers,
Doru


On Mon, Oct 6, 2014 at 1:20 PM, Sven Van Caekenberghe <s...@stfx.eu> wrote:

> I think the titles of GT-Inspector windows/panes are a bit silly:
>
>
> Notice the 'a ZnClient(a ZnClient)' and 'a Dictionary(a Dictionary(...))'
> where the class name is repeated.
>
> I think it is very important to honour the standard/general Smalltalk
> approach and assume the #printString already contains the class name. If
> not, you are basically punishing everybody who went through the trouble of
> writing custom #printString implementation (like me, I do this for most
> classes).
>
> I saw the whole #display thing, but you can't force everybody to rewrite
> #printString to #gtDisplayString or whatever.
>
> Sven
>
>


-- 
www.tudorgirba.com

"Every thing has its own flow"

Reply via email to