Morph: event handler on wrong morph/submorph

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

Morph: event handler on wrong morph/submorph

Federico.Balaguer
Hello,

I found a problem with BotArena (http://smalltalkhub.com/#!/~FedericoBalaguer/BotArena) on Pharo 4.

BotArena is an interactive robot simulation environment that we use in my university to teach OOP basics. BotArena was developed as an instantiation of BOSS (http://smalltalkhub.com/#!/~CAR/BOSS/).

BotArena (as well as BOSS) has a window (Morph) that has three buttons and a grid view that is subclass of BorderedMorph. The GridView can handle RedButtons, a click on the grid adds a new robot to the simulation.

The problem that raised on Pharo4 is that, after a RedButton event, any event (focus to another pharo window or clicking on one of the buttons of BotArena) will be handled by the GridView.

It seems like the GridView retains the focus after the (first) RedButton event was handled.

Could someone help me to sort this one out?

Thanks! Federico
Reply | Threaded
Open this post in threaded view
|

Re: Morph: event handler on wrong morph/submorph

Stephan Eggermont-3
On 28/09/15 18:59, Federico.Balaguer wrote:

> Hello,
>
> I found a problem with BotArena
> (http://smalltalkhub.com/#!/~FedericoBalaguer/BotArena) on Pharo 4.
>
> BotArena is an interactive robot simulation environment that we use in my
> university to teach OOP basics. BotArena was developed as an instantiation
> of BOSS (http://smalltalkhub.com/#!/~CAR/BOSS/).
>
> BotArena (as well as BOSS) has a window (Morph) that has three buttons and a
> grid view that is subclass of BorderedMorph. The GridView can handle
> RedButtons, a click on the grid adds a new robot to the simulation.
>
> The problem that raised on Pharo4 is that, after a RedButton event, any
> event (focus to another pharo window or clicking on one of the buttons of
> BotArena) will be handled by the GridView.
>
> It seems like the GridView retains the focus after the (first) RedButton
> event was handled.
>
> Could someone help me to sort this one out?

What is the entry point to the application? I could start a
BGSCar2012DemoSimulation, and that doesn't allow extra robots.

Stephan



Reply | Threaded
Open this post in threaded view
|

Re: Morph: event handler on wrong morph/submorph

Federico.Balaguer
Hello  Stephan,

the following line will open the tool I was referring to:

BGSArenaWindow expertViewOn: (OnTheFlyConfigurableSimulation endlessWalkingBrush).

There is two ways to add a new robot:
1. Click on the Add Robot button, which has no problem

2. Click on the grid

Regards. Federico

Reply | Threaded
Open this post in threaded view
|

Re: Morph: event handler on wrong morph/submorph

Henrik Nergaard
This post has NOT been accepted by the mailing list yet.
The issue is caused by a change in Morph>>#OpenModal: where the ensure block adds back the old mouse focus after the add robot window is closed (self activeHand mouseFocus: mouseFocus).

adding: self activeHand mouseFocus: nil at the bottom of the code in BotArenaGridView>>#mouseDownEvt: is one way to *fix* it.


Best regards,
Henrik
Reply | Threaded
Open this post in threaded view
|

Re: Morph: event handler on wrong morph/submorph

Nicolai Hess
In reply to this post by Federico.Balaguer


2015-09-28 18:59 GMT+02:00 Federico.Balaguer <[hidden email]>:
Hello,

I found a problem with BotArena
(http://smalltalkhub.com/#!/~FedericoBalaguer/BotArena) on Pharo 4.

BotArena is an interactive robot simulation environment that we use in my
university to teach OOP basics. BotArena was developed as an instantiation
of BOSS (http://smalltalkhub.com/#!/~CAR/BOSS/).

BotArena (as well as BOSS) has a window (Morph) that has three buttons and a
grid view that is subclass of BorderedMorph. The GridView can handle
RedButtons, a click on the grid adds a new robot to the simulation.

The problem that raised on Pharo4 is that, after a RedButton event, any
event (focus to another pharo window or clicking on one of the buttons of
BotArena) will be handled by the GridView.

It seems like the GridView retains the focus after the (first) RedButton
event was handled.

Could someone help me to sort this one out?

Quick solution:

use
self on: #click send: #mouseDownEvt: to: self.
in BotArenaGridView for registering the event dispatcher.

The problem is a change I did in 40422. I tried to fix another issue with for the #click action.
Now we have to find a solution that works for both, #mouseDown and #click.

nicolai

 

Thanks! Federico



--
View this message in context: http://forum.world.st/Morph-event-handler-on-wrong-morph-submorph-tp4852370.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Morph: event handler on wrong morph/submorph

Federico.Balaguer
In reply to this post by Henrik Nergaard
Thanks a lot!

Federico
Reply | Threaded
Open this post in threaded view
|

Re: Morph: event handler on wrong morph/submorph

Federico.Balaguer
In reply to this post by Nicolai Hess
Thanks for the reply.

Federico
Reply | Threaded
Open this post in threaded view
|

Re: Morph: event handler on wrong morph/submorph

stepharo
In reply to this post by Federico.Balaguer
Hi federico

could you
     - show it to damien when he will come to Laplata?
     - could you produce a small video because I would like to share it
with other teachers?

Stef

Le 28/9/15 18:59, Federico.Balaguer a écrit :

> Hello,
>
> I found a problem with BotArena
> (http://smalltalkhub.com/#!/~FedericoBalaguer/BotArena) on Pharo 4.
>
> BotArena is an interactive robot simulation environment that we use in my
> university to teach OOP basics. BotArena was developed as an instantiation
> of BOSS (http://smalltalkhub.com/#!/~CAR/BOSS/).
>
> BotArena (as well as BOSS) has a window (Morph) that has three buttons and a
> grid view that is subclass of BorderedMorph. The GridView can handle
> RedButtons, a click on the grid adds a new robot to the simulation.
>
> The problem that raised on Pharo4 is that, after a RedButton event, any
> event (focus to another pharo window or clicking on one of the buttons of
> BotArena) will be handled by the GridView.
>
> It seems like the GridView retains the focus after the (first) RedButton
> event was handled.
>
> Could someone help me to sort this one out?
>
> Thanks! Federico
>
>
>
> --
> View this message in context: http://forum.world.st/Morph-event-handler-on-wrong-morph-submorph-tp4852370.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Morph: event handler on wrong morph/submorph

Federico.Balaguer

Yes!

On Oct 3, 2015 3:57 AM, "stepharo [via Smalltalk]" <[hidden email]> wrote:
Hi federico

could you
     - show it to damien when he will come to Laplata?
     - could you produce a small video because I would like to share it
with other teachers?

Stef

Le 28/9/15 18:59, Federico.Balaguer a écrit :

> Hello,
>
> I found a problem with BotArena
> (http://smalltalkhub.com/#!/~FedericoBalaguer/BotArena) on Pharo 4.
>
> BotArena is an interactive robot simulation environment that we use in my
> university to teach OOP basics. BotArena was developed as an instantiation
> of BOSS (http://smalltalkhub.com/#!/~CAR/BOSS/).
>
> BotArena (as well as BOSS) has a window (Morph) that has three buttons and a
> grid view that is subclass of BorderedMorph. The GridView can handle
> RedButtons, a click on the grid adds a new robot to the simulation.
>
> The problem that raised on Pharo4 is that, after a RedButton event, any
> event (focus to another pharo window or clicking on one of the buttons of
> BotArena) will be handled by the GridView.
>
> It seems like the GridView retains the focus after the (first) RedButton
> event was handled.
>
> Could someone help me to sort this one out?
>
> Thanks! Federico
>
>
>
> --
> View this message in context: http://forum.world.st/Morph-event-handler-on-wrong-morph-submorph-tp4852370.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>




If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Morph-event-handler-on-wrong-morph-submorph-tp4852370p4853384.html
To unsubscribe from Morph: event handler on wrong morph/submorph, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Morph: event handler on wrong morph/submorph

Federico.Balaguer
In reply to this post by stepharo
Hello Stephan,

could you introduce me to Damien so I can organize a meeting with him?

Thanks. Federico

On Sat, Oct 3, 2015 at 3:47 AM, stepharo [via Smalltalk] <[hidden email]> wrote:
Hi federico

could you
     - show it to damien when he will come to Laplata?
     - could you produce a small video because I would like to share it
with other teachers?

Stef

Le 28/9/15 18:59, Federico.Balaguer a écrit :

> Hello,
>
> I found a problem with BotArena
> (http://smalltalkhub.com/#!/~FedericoBalaguer/BotArena) on Pharo 4.
>
> BotArena is an interactive robot simulation environment that we use in my
> university to teach OOP basics. BotArena was developed as an instantiation
> of BOSS (http://smalltalkhub.com/#!/~CAR/BOSS/).
>
> BotArena (as well as BOSS) has a window (Morph) that has three buttons and a
> grid view that is subclass of BorderedMorph. The GridView can handle
> RedButtons, a click on the grid adds a new robot to the simulation.
>
> The problem that raised on Pharo4 is that, after a RedButton event, any
> event (focus to another pharo window or clicking on one of the buttons of
> BotArena) will be handled by the GridView.
>
> It seems like the GridView retains the focus after the (first) RedButton
> event was handled.
>
> Could someone help me to sort this one out?
>
> Thanks! Federico
>
>
>
> --
> View this message in context: http://forum.world.st/Morph-event-handler-on-wrong-morph-submorph-tp4852370.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>





If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Morph-event-handler-on-wrong-morph-submorph-tp4852370p4853384.html
To unsubscribe from Morph: event handler on wrong morph/submorph, click here.
NAML