[Pharo-dev] Spec delete method

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

[Pharo-dev] Spec delete method

Stéphane Ducasse
Hi ben

I would like to unsubscribe announcement when the window is closed.
Is there a hook for that in Spec?

Stef




Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Spec delete method

Benjamin Van Ryseghem (Pharo)
I do not think it's a UI framework concern to handle model behaviour (like registration to announcement)

Ben

On Jul 17, 2013, at 9:40 AM, Stéphane Ducasse <[hidden email]> wrote:

Hi ben

I would like to unsubscribe announcement when the window is closed.
Is there a hook for that in Spec?

Stef





Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Spec delete method

Tudor Girba-2
I guess what Stef means is that he would like to know if there is a way specify custom behavior when a window closes, and then use this for his purpose of unregistering from some announcer.

Cheers,
Doru


On Wed, Jul 17, 2013 at 2:36 PM, Benjamin <[hidden email]> wrote:
I do not think it's a UI framework concern to handle model behaviour (like registration to announcement)

Ben

On Jul 17, 2013, at 9:40 AM, Stéphane Ducasse <[hidden email]> wrote:

Hi ben

I would like to unsubscribe announcement when the window is closed.
Is there a hook for that in Spec?

Stef








--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Spec delete method

Benjamin Van Ryseghem (Pharo)
Ok :)

Then there is a hook in Morph for that I think :)
(and an announcement in Spec when a widget is built)

Ben

On Jul 17, 2013, at 3:37 PM, Tudor Girba <[hidden email]> wrote:

I guess what Stef means is that he would like to know if there is a way specify custom behavior when a window closes, and then use this for his purpose of unregistering from some announcer.

Cheers,
Doru


On Wed, Jul 17, 2013 at 2:36 PM, Benjamin <[hidden email]> wrote:
I do not think it's a UI framework concern to handle model behaviour (like registration to announcement)

Ben

On Jul 17, 2013, at 9:40 AM, Stéphane Ducasse <[hidden email]> wrote:

Hi ben

I would like to unsubscribe announcement when the window is closed.
Is there a hook for that in Spec?

Stef








--

"Every thing has its own flow"

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Spec delete method

Andrei Chis
You can add this to the initialize method of your widget, and in the close method unregister all announcers

  self whenWindowChanged: [:w | w whenClosedDo: [ self close ] ].


Andrei

On Wed, Jul 17, 2013 at 3:42 PM, Benjamin <[hidden email]> wrote:
Ok :)

Then there is a hook in Morph for that I think :)
(and an announcement in Spec when a widget is built)

Ben

On Jul 17, 2013, at 3:37 PM, Tudor Girba <[hidden email]> wrote:

I guess what Stef means is that he would like to know if there is a way specify custom behavior when a window closes, and then use this for his purpose of unregistering from some announcer.

Cheers,
Doru


On Wed, Jul 17, 2013 at 2:36 PM, Benjamin <[hidden email]> wrote:
I do not think it's a UI framework concern to handle model behaviour (like registration to announcement)

Ben

On Jul 17, 2013, at 9:40 AM, Stéphane Ducasse <[hidden email]> wrote:

Hi ben

I would like to unsubscribe announcement when the window is closed.
Is there a hook for that in Spec?

Stef








--

"Every thing has its own flow"


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Spec delete method

Stéphane Ducasse
In reply to this post by Benjamin Van Ryseghem (Pharo)

I do not think it's a UI framework concern to handle model behaviour (like registration to announcement)

Ben 
I notice that more frequently in your replies. To not judge people. We do not need it.
We are all good programmers. I need to know if there is a hook not that you 
explain me that my design is bad, because it is not ;) I think that I know what are layer, MVP, MVC and little friends are. 

This is not my model behavior. I want my ui not to get notification
from my model anymore. So to me this is the responsibility of the UI to unregister itself
and I do not see who else could do it. 

I have again the same problem that my Spec UI instance is not garbage collected and 
I only use weak announcements and I need to understand why.

Stef



Ben

On Jul 17, 2013, at 9:40 AM, Stéphane Ducasse <[hidden email]> wrote:

Hi ben

I would like to unsubscribe announcement when the window is closed.
Is there a hook for that in Spec?

Stef






Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Spec delete method

Stéphane Ducasse
In reply to this post by Andrei Chis
thanks

Stef


You can add this to the initialize method of your widget, and in the close method unregister all announcers

  self whenWindowChanged: [:w | w whenClosedDo: [ self close ] ].


Andrei

On Wed, Jul 17, 2013 at 3:42 PM, Benjamin <[hidden email]> wrote:
Ok :)

Then there is a hook in Morph for that I think :)
(and an announcement in Spec when a widget is built)

Ben

On Jul 17, 2013, at 3:37 PM, Tudor Girba <[hidden email]> wrote:

I guess what Stef means is that he would like to know if there is a way specify custom behavior when a window closes, and then use this for his purpose of unregistering from some announcer.

Cheers,
Doru


On Wed, Jul 17, 2013 at 2:36 PM, Benjamin <[hidden email]> wrote:
I do not think it's a UI framework concern to handle model behaviour (like registration to announcement)

Ben

On Jul 17, 2013, at 9:40 AM, Stéphane Ducasse <[hidden email]> wrote:

Hi ben

I would like to unsubscribe announcement when the window is closed.
Is there a hook for that in Spec?

Stef








--

"Every thing has its own flow"



Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Spec delete method

Benjamin Van Ryseghem (Pharo)
In reply to this post by Stéphane Ducasse
SOrry, it was not my intention :(

Ben

On Jul 17, 2013, at 8:07 PM, Stéphane Ducasse <[hidden email]> wrote:


I do not think it's a UI framework concern to handle model behaviour (like registration to announcement)

Ben 
I notice that more frequently in your replies. To not judge people. We do not need it.
We are all good programmers. I need to know if there is a hook not that you 
explain me that my design is bad, because it is not ;) I think that I know what are layer, MVP, MVC and little friends are. 

This is not my model behavior. I want my ui not to get notification
from my model anymore. So to me this is the responsibility of the UI to unregister itself
and I do not see who else could do it. 

I have again the same problem that my Spec UI instance is not garbage collected and 
I only use weak announcements and I need to understand why.

Stef



Ben

On Jul 17, 2013, at 9:40 AM, Stéphane Ducasse <[hidden email]> wrote:

Hi ben

I would like to unsubscribe announcement when the window is closed.
Is there a hook for that in Spec?

Stef







Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Spec delete method

Stéphane Ducasse

On Jul 17, 2013, at 8:15 PM, Benjamin <[hidden email]> wrote:

SOrry, it was not my intention :(

Ok I just tell you because I know that you are not like that :)

I loaded my code in the fresh and latest 30 and invoking the GC this time 
removed the UI instance. So I prefer that.

Now my logging frameworks can get a streamLogger that displays information by default in the 
transcript and in the UILogger.
I'm getting where I wanted.

Stef



Ben

On Jul 17, 2013, at 8:07 PM, Stéphane Ducasse <[hidden email]> wrote:


I do not think it's a UI framework concern to handle model behaviour (like registration to announcement)

Ben 
I notice that more frequently in your replies. To not judge people. We do not need it.
We are all good programmers. I need to know if there is a hook not that you 
explain me that my design is bad, because it is not ;) I think that I know what are layer, MVP, MVC and little friends are. 

This is not my model behavior. I want my ui not to get notification
from my model anymore. So to me this is the responsibility of the UI to unregister itself
and I do not see who else could do it. 

I have again the same problem that my Spec UI instance is not garbage collected and 
I only use weak announcements and I need to understand why.

Stef



Ben

On Jul 17, 2013, at 9:40 AM, Stéphane Ducasse <[hidden email]> wrote:

Hi ben

I would like to unsubscribe announcement when the window is closed.
Is there a hook for that in Spec?

Stef