On 23/10/2008, at 1:05 AM, David Roethlisberger wrote:
Any possibility to see how you do this browser?
It's a commercial effort, but I will explain it.
Could you elaborate on that? I don't quite get this. How is the fact that we use text (or string) to represent labels of items to be rendered in lists related to the space usage in these lists due to icons?
Because the decision about how to represent those things is taken too early - in the model in effect. This is because of the #displayString:forNode: model. The system commits to a concrete (and very limited) representation too early.
This annotated text is just one representation of the item, the icon is another one (kind of). So how could help us another abstraction here?
Rather than using strings, I use an object that represents an annotated label, which HAS a string but IS NOT a string. Filters can add/change annotations (nv-pairs) and when the list comes to render the item *the list* can decide how to render the string (which isn't styled) and the annotations. This is appropriate because the list is the first time the presentation object hits the UI. The renderer on the list can use a strategy pattern for different contexts and/or UI mechanisms.
So the render can add more space and different locations for different types of things, and it can even do it dynamically e.g. adding an icon column if ANY item has a certain class of annotation - although that presumes a non-lazy implementation, which I use because I've completely re-implemented lists, scrollpanes, scrollbars etc.
Furthermore the label object can carry a reference to the original model object, which makes DnD and command discovery/invocation more straightforward.
I think there's too much unconsidered reuse in Squeak e.g. "Text looks like it sort of does what we want, *and it will be quick to do* - let's use that". IMO this is partly due to the 'playground' nature of Squeak, where the quality of the vision and specific goals are lost in a sea of playful expediency, and partly inherent to Smalltalk.
Antony Blakey ------------- CTO, Linkuistics Pty Ltd Ph: 0438 840 787 Borrow money from pessimists - they don't expect it back. -- Steven Wright _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
