If you want to react to some selection, you should better use whenSelectedItemChanged: I guess
Ben On Sep 17, 2013, at 4:00 AM, Nicolas Passerini <[email protected]> wrote: > > If your UI is based on multi selection (and Nautilus definitely is) you > should not register to whenSelectedIndexChanged:/whenSelectedItemChanged:, > but only the plural version. > > Ok, I get that. > Still, when you create a NewList you have to provide a setIndexSelector, for > example in the CategoryWidget I am doing: > > categoriesList := NewList > on: self > getItemsSelector: #getCategories > setIndexSelector: #selectedCategoryIndex: > getDisplaySelector: #categoryWrapper:. > > So, every time you click on the categories list (both selecting multiple > categories or not) the CategoryWidget receives the #selectedCategoryIndex: > message. > The current selectedCategoryIndex: message reads like this: > > selectedCategoryIndex: anInteger > > | anObject | > anObject := self getCategories at: anInteger ifAbsent: [ nil ]. > self model selectedCategory: anObject. > > self changed: #selectedCategoryIndex. > self model categorySelectionChanged. > self model changed: #currentHistoryIndex. > > > Also the NewList is in the list of dependents of the CategoryWidget, so it > also gets the #update: message > Is this right?
