#quitSession

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

#quitSession

HilaireFernandes
Hello,

I would like to change the behavior of Pharo when the user clicks on the
close button of the host window.

So far it looks like #quitSession is sended from somewhere, but I fail
to see the chain of call between the host window and the #quitSession
message.

Any idea?

Thanks

Hilaire


--
Dr. Geo - http://drgeo.eu
iStoa - http://istoa.drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: #quitSession

Guillermo Polito
I'd bet it is...

PasteUpMorph>>windowEvent: anEvent
self windowEventHandler
ifNotNil: [^self windowEventHandler windowEvent: anEvent].

anEvent type == #windowClose
ifTrue: [WorldState quitSession].

and #windowsEvent: is called in a sequence like:

VM event => InputEventFetcher => Morphic event => PasteUpMorph ...

On Wed, Oct 1, 2014 at 1:48 PM, Hilaire <[hidden email]> wrote:
Hello,

I would like to change the behavior of Pharo when the user clicks on the
close button of the host window.

So far it looks like #quitSession is sended from somewhere, but I fail
to see the chain of call between the host window and the #quitSession
message.

Any idea?

Thanks

Hilaire


--
Dr. Geo - http://drgeo.eu
iStoa - http://istoa.drgeo.eu



Reply | Threaded
Open this post in threaded view
|

Re: #quitSession

HilaireFernandes
We have nothing like Announcer we can hook to?

Thanks

Hilaire

Le 01/10/2014 13:51, Guillermo Polito a écrit :

> I'd bet it is...
>
> PasteUpMorph>>windowEvent: anEvent
> self windowEventHandler
> ifNotNil: [^self windowEventHandler windowEvent: anEvent].
>
> anEvent type == #windowClose
> ifTrue: [WorldState quitSession].
>
> and #windowsEvent: is called in a sequence like:
>
> VM event => InputEventFetcher => Morphic event => PasteUpMorph ...
>
> On Wed, Oct 1, 2014 at 1:48 PM, Hilaire <[hidden email]> wrote:
>
>> Hello,
>>
>> I would like to change the behavior of Pharo when the user clicks on the
>> close button of the host window.
>>
>> So far it looks like #quitSession is sended from somewhere, but I fail
>> to see the chain of call between the host window and the #quitSession
>> message.
>>
>> Any idea?
>>
>> Thanks
>>
>> Hilaire
>>
>>
>> --
>> Dr. Geo - http://drgeo.eu
>> iStoa - http://istoa.drgeo.eu
>>
>>
>>
>


--
Dr. Geo - http://drgeo.eu
iStoa - http://istoa.drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: #quitSession

HilaireFernandes
In reply to this post by Guillermo Polito

> ifNotNil: [^self windowEventHandler windowEvent: anEvent].

Just a remark
Looking at this code and the protocol, self windowEventHandler must
responds a Morph. There are no such things as a WindowEventHandler in
the image. A bit misleading.
This whole implementation smell. I guess we can get something cleaner
with Announcement


Hilaire


Le 01/10/2014 13:51, Guillermo Polito a écrit :

> I'd bet it is...
>
> PasteUpMorph>>windowEvent: anEvent
> self windowEventHandler
> ifNotNil: [^self windowEventHandler windowEvent: anEvent].
>
> anEvent type == #windowClose
> ifTrue: [WorldState quitSession].
>
> and #windowsEvent: is called in a sequence like:
>
> VM event => InputEventFetcher => Morphic event => PasteUpMorph ...
>
> On Wed, Oct 1, 2014 at 1:48 PM, Hilaire <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hello,
>
>     I would like to change the behavior of Pharo when the user clicks on the
>     close button of the host window.
>
>     So far it looks like #quitSession is sended from somewhere, but I fail
>     to see the chain of call between the host window and the #quitSession
>     message.
>
>     Any idea?
>
>     Thanks
>
>     Hilaire
>
>
>     --
>     Dr. Geo - http://drgeo.eu
>     iStoa - http://istoa.drgeo.eu
>
>
>


--
Dr. Geo - http://drgeo.eu
iStoa - http://istoa.drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: #quitSession

Guillermo Polito


On Wed, Oct 8, 2014 at 10:26 AM, Hilaire <[hidden email]> wrote:

> ifNotNil: [^self windowEventHandler windowEvent: anEvent].

Just a remark
Looking at this code and the protocol, self windowEventHandler must
responds a Morph. There are no such things as a WindowEventHandler in
the image. A bit misleading.
This whole implementation smell.

I'd say nobody used it before and that's why it is like it is :). Just old unused code.
 
I guess we can get something cleaner
with Announcement

Sure!
 


Hilaire


Le 01/10/2014 13:51, Guillermo Polito a écrit :
> I'd bet it is...
>
> PasteUpMorph>>windowEvent: anEvent
> self windowEventHandler
> ifNotNil: [^self windowEventHandler windowEvent: anEvent].
>
> anEvent type == #windowClose
> ifTrue: [WorldState quitSession].
>
> and #windowsEvent: is called in a sequence like:
>
> VM event => InputEventFetcher => Morphic event => PasteUpMorph ...
>
> On Wed, Oct 1, 2014 at 1:48 PM, Hilaire <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hello,
>
>     I would like to change the behavior of Pharo when the user clicks on the
>     close button of the host window.
>
>     So far it looks like #quitSession is sended from somewhere, but I fail
>     to see the chain of call between the host window and the #quitSession
>     message.
>
>     Any idea?
>
>     Thanks
>
>     Hilaire
>
>
>     --
>     Dr. Geo - http://drgeo.eu
>     iStoa - http://istoa.drgeo.eu
>
>
>


--
Dr. Geo - http://drgeo.eu
iStoa - http://istoa.drgeo.eu



Reply | Threaded
Open this post in threaded view
|

Re: #quitSession

HilaireFernandes
Le 08/10/2014 10:30, Guillermo Polito a écrit :
> I'd say nobody used it before and that's why it is like it is :). Just
> old unused code.

Now I use it as it is now, at least I don't have to override system
method to trap the quit session

>  
>
>     I guess we can get something cleaner
>     with Announcement
>
>
> Sure!

I should take a look

Thanks

Hilaire



--
Dr. Geo - http://drgeo.eu
iStoa - http://istoa.drgeo.eu