[Cuis-dev] FlatFileList
Mariano Montone
marianomontone at gmail.com
Sun May 8 07:01:49 PDT 2022
El 8/5/22 a las 10:07, Mariano Montone escribió:
> Hi Luciano,
>
> El 8/5/22 a las 04:00, Luciano Notarfrancesco escribió:
>> Hi Mariano,
> And why did you find the need to subclass InnerListMorph and
> PluggableListMorph and add the instance variable itemPrinter?
> Originally PluggableListMorph is designed to get a list of strings
> from the model, and on selection it tells the model the selected index
> in the list. It seems that so far we didn’t have the need to allow
> arbitrary objects in the lists and using just strings was enough. I
> wonder if we can do the same here, and otherwise if we should make the
> PluggableListMorph “even more pluggable” by allowing arbitrary objects
> as items and avoid adding those two special subclasses with itemPrinting.
>
> Yes. I've done this many times. I really, really want to work with the
> underlying objects, not the strings. For example, the flat file
> browser displays only the name of the file entries, not the full path.
> Also, I'm considering using something like <filename> - <date> -
> <size> .. I wouldn't want to have to parse FileEntries back from those
> string representations..
>
> Now that I think about it, I could use PluggableListMorph with some
> ItemWrapper with the custom printing, instead of subclassing the list
> morph, but still, it would be another inconvenience having to
> wrap/unwrap.
>
> I have an extension of PluggableListMorph in another package that
> supports both itemPrinting and icons. I often use that in my projects;
> not this time, as I didn't want to introduce a package dependency.
>
> So, yes, making PluggableListMorph more pluggable would be something
> worth considering IMO.
>
I've removed the extended PluggableLists, and I'm using
PluggableListMorphs with accessors that retrieve the list of printed
representations of the model collections, like:
directoryListNames
^ model currentDirectoryList collect: [:dir | dir name]
Still, I think I would consider adding pluggable printers. Also, option
of using icons in lists could be useful? I use that in some of my
projects ...
Cheers,
Mariano
More information about the Cuis-dev
mailing list