I did not check but we should avoid isKindOf: and we should avoid different 
protocol that after leads to ugly code.

> 
> 
> 
> Now @
> https://pharo.fogbugz.com/f/cases/6489/Spec-ify-DropListModel-TextModel
> Fix in inbox:
> SLICE-Issue-6489-Spec-ify-DropListModel--TextModel-SeanDeNigris.1
> 
> It's a little ugly because I wanted to preserve the old raw-string behavior
> for now.
> 
> Instead of:
> colorItems := #('Green' 'Red' 'Yellow') collect: [ :e | DropListItem named:
> e do: [] ].
> colorModel
>    items: colorItems.
> And then matching the strings that come back (yuck)...
> 
> You can now say:
> colorModel
>    items: { Color green. Color red. Color yellow };
>    displayBlock: [ :e | e name capitalized ].
> 
> And then:
> colorModel whenSelectedItemChangedDo: [ :color | Transcript show: color
> brightness ].
> 
> I also uploaded a version for 2.0 to the old
> (http://ss3.gemstone.com/ss/PharoInbox/) inbox and at
> http://ss3.gemstone.com/ss/PharoSpd for those (like me) who can't wait until
> 3.0 to use it ;)
> 
> 
> 
> -----
> Cheers,
> Sean
> --
> View this message in context: 
> http://forum.world.st/Spec-DropLists-tp4643694p4681720.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
> 


Reply via email to