"Davorin Rusevljan" <
[hidden email]> wrote in message
news:99f0en$ds5g$
[hidden email]...
> I have been playing around card presenter. Iwanted to catch the moment
when
> current card is changed. My first try was to hook-up to CompositePresenter
> in hope it will pass-along currentCardChanged, but it did not work.
Here is what I am doing currently. BigPresenter has an instance variable
'cardPresenter' and in the view composer I name the corresponding widget
'cards'. I guess you are right, that I'm not really using the presenter
much. But in case it helps, here it is.
BigPresenter>>createComponents
super createComponents.
cardPresenter := self add: CompositePresenter new name: 'cards'.
then I attach to the card changed and changing events this way:
BigPresenter>>createSchematicWiring
super createSchematicWiring.
cardPresenter view
when: #currentCardChanging: send: #onCardChanging: to: self;
when: #currentCardChanged send: #onCardChanged to: self.
Then in the #onCardChanging: (for the card being left) and #onCardChanged
(for the new card) methods on BigPresenter, I can get the card and/or its
presenter like this:
| currentCard currentPresenter |
currentCard := cardPresenter view currentCard.
currentPresenter := cardPresenter presenterNamed: currentCard name.
-- Frank
[hidden email]