[Newbies] Displaying rows of data, PluggableMultiColumnListMorph

Matthew Fulmer tapplek at gmail.com
Sat Oct 13 19:12:58 UTC 2007


On Fri, Oct 12, 2007 at 06:56:55PM +0200, Peter Schneider wrote:
>    Hello,
> 
>    i want to display the results of an ongoing calculation. I'm not terribly
>    concerned about speed, as this is just for educational purposes.
>    So i figured that PluggableMultiColumnListMorph would be a good place to
>    start.
>    My problem now is, that it only wants to take Arrays as its source list.
>    Because i don't know how many rows of data need to be displayed, i just
>    threw all of them in an OrderedCollection.
>    If i convert this OrderedCollection with "asArray" and feed it to the
>    MultiColoumnMorph the contents are displayed just fine, but i can't select
>    any entries or navigate using the arrow keys.
>    In fact, i can only select as much entries as there are columns in the
>    Morph.
> 
>    To illustrate, i did something roughly similiar to the following:
> 
>    |column1 column2|
>        result := OrderedCollection new.
>        column1 := OrderedCollection new.
>        column2 := OrderedCollection new.
>        column1 add: 'x-component'; add: 'purz'; add: 'durst'; add: 'puh'.
>        column2 add: 'y-component'; add: 'purz1'; add: 'durst1'; add: 'puh1'.
>        result add: (column1 asArray); add: (column2 asArray).
>        result := result asArray.

I don't understand how this hooks up to
PluggableMultiColumnListMorph. Is this the getListSelector code?
Looking at the class comment, it says getListSelector should
return an OrderedCollection of Arrays, where each Array is a
row. You seem to be doing something in column-major order, so I
don't really see how this code is supposed to work

-- 
Matthew Fulmer -- http://mtfulmer.wordpress.com/
Help improve Squeak Documentation: http://wiki.squeak.org/squeak/808


More information about the Beginners mailing list