Howto un- when:#someTriggerdEven send:#whatEverMessage to:#whateverReceipient

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Howto un- when:#someTriggerdEven send:#whatEverMessage to:#whateverReceipient

Günther Schmidt
Hi,

Let's say, I've got a persistently displayed view on changing objects.

Let's say, when I set the model to this presenter I send a
modelA when:#whatEverEvent send:#modelAspectChanged to: self "the
presenter".

Let's say I change the model on that presenter and also send
modelB when:#whatEverEvent send:#modelAspectChanged to: self "the
presenter".
to that new model.

I presume my presenter keeps receiving events even from the previous
model(s) (modelA), which it is no longer interessted in, but without
being able to tell.

So is there a possibility to "unregister" interesst in receiving
messages on triggered events?

Günther


Reply | Threaded
Open this post in threaded view
|

Re: Howto un- when:#someTriggerdEven send:#whatEverMessage to:#whateverReceipient

Louis Sumberg-3
Hi Gunther,

> So is there a possibility to "unregister" interesst in receiving
> messages on triggered events?

 From the presenter, try:
    aModel removeEventsTriggeredFor: self

-- Louis


Reply | Threaded
Open this post in threaded view
|

Re: Howto un- when:#someTriggerdEven send:#whatEverMessage to:#whateverReceipient

Schwab,Wilhelm K
In reply to this post by Günther Schmidt
Günther,

> I presume my presenter keeps receiving events even from the previous
> model(s) (modelA), which it is no longer interessted in, but without
> being able to tell.

Yes, but the registrations are weak, so they presenter will be GCd as
shortly after closing, so it is not a problem under normal circumstances.

Louis already addressed how to explicitly unregister, which you can do
if necessary.

Have a good one,

Bill


--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Howto un- when:#someTriggerdEven send:#whatEverMessage to:#whateverReceipient

Günther Schmidt
In reply to this post by Louis Sumberg-3
Dear Louis,

thanks, I'm just going through your Personal Money tutorial, it's a
great help.

I just haven't found the part yet where one adds to the accountTypes
list through the type in from the ComboBox.

Did I just not get there yet or is that missing from your tutorial?

Thanks once more

Günther


Louis Sumberg schrieb:

> Hi Gunther,
>
>> So is there a possibility to "unregister" interesst in receiving
>> messages on triggered events?
>
>
>  From the presenter, try:
>    aModel removeEventsTriggeredFor: self
>
> -- Louis


Reply | Threaded
Open this post in threaded view
|

Re: Howto un- when:#someTriggerdEven send:#whatEverMessage to:#whateverReceipient

Louis Sumberg-3
Hi Gunther,

> thanks, I'm just going through your Personal Money tutorial, it's a
> great help.

That's nice to hear :)

> I just haven't found the part yet where one adds to the accountTypes
> list through the type in from the ComboBox.

See part 5 for: "We expect that the user will either choose an existing
item from the dropdown list or will type a new name in the combobox's
edit control.  In the latter case, we need to make the combobox
editable, i.e., watch for when a new category is typed in and then add
it to the categories list."

Part 6 also has: "The editable combo box is expanded to search for
partial user-typed entries."

It would be nice if I condensed this into a cookbook thing, but I
haven't, so sorry, you have to wade through a bunch of things to glean
what you want.

-- Louis