Search code examples
user-interfacesmalltalkpharospec-ui

Change list background color in Pharo with Spec


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.


Solution

  • Nicolai Hess proposed this workaround on the Pharo Dev list:

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