Change list background color in Pharo with Spec

274 Views Asked by At

Is this supposed to change a list background color to red in Pharo?

ListModel new 
    items: (1 to: 10);
    color: Color red;
    openWithSpec.

Because it's always white no matter what, nothing happens.

2

There are 2 best solutions below

0
On BEST ANSWER

Nicolai Hess proposed this workaround on the Pharo Dev list:

ListModel new 
    items: (1 to: 10);
    backgroundColorBlock: [ :item :index |Color red ];
    openWithSpec.
0
On

That's actually a Morphic issue.

It needs a massive refactoring to allow this feature, so sadly it's not planned for anytime soon.

Sorry Benjamin Van Ryseghem