Tweak events

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

Tweak events

Liz Wendland-2
Hi,

There is probably a very obvious answer to this question...

How does my Tweak object tell Croquet which events it wants to handle?

For Croquet Objects such as TFrame I can set the eventMask.  I believe
the same is true for Morphic objects.  With Tweak I have played around
with methods such as handlesEvent: on both the costume and the object
and even though I set them to return false for things such as mousedown,
the mouse down event never gets passed on.

I would like to have a Tweak object which I can click through and do
things in the Croquet Space.  If my Tweak object contains anything that
ever could handle mouse down (such as scroll pane in my case) even
though I override the handlesEvent: I cannot pass that mouse click on to
Croquet.

What am I doing wrong?  Thanks in advance for any help,
Liz Wendland

Reply | Threaded
Open this post in threaded view
|

Re: Tweak events

Tapple Gao
On Wed, Oct 29, 2008 at 09:24:37AM -0400, liz wrote:

> Hi,
>
> There is probably a very obvious answer to this question...
>
> How does my Tweak object tell Croquet which events it wants to handle?
>
> For Croquet Objects such as TFrame I can set the eventMask.  I believe
> the same is true for Morphic objects.  With Tweak I have played around
> with methods such as handlesEvent: on both the costume and the object
> and even though I set them to return false for things such as mousedown,
> the mouse down event never gets passed on.
>
> I would like to have a Tweak object which I can click through and do
> things in the Croquet Space.  If my Tweak object contains anything that
> ever could handle mouse down (such as scroll pane in my case) even
> though I override the handlesEvent: I cannot pass that mouse click on to
> Croquet.
>
> What am I doing wrong?  Thanks in advance for any help,
> Liz Wendland
>

Tweak does event handling completely different than Morphic or
Croquet. You probably want one of these three methods:

onClick
    <on: mouseClick>
    "Your code here"

onMouseDown
    <on: mouseDown>
    "Your code here"

onFire
    <on: fire>
    "Your code here"

See these two pages:

http://tweakproject.org/TECHNOLOGY/Tutorials/BankAccountTutorial/
http://tweakproject.org/TECHNOLOGY/Documentation/PlayerEvents/

--
Matthew Fulmer -- http://mtfulmer.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: Tweak events

Liz Wendland-2
Hi Matthew,

Thank your  for your reply.  I have used the Tweak event handling quite
a bit and it is very nice.  My current problem is that I DO NOT want to
handle these events and I want Tweak to pass them on to the Croquet
environment.   I believe there is a way to indicate that certain events
should be ignored, but I'm not sure how to do that from Tweak.

Thanks!
Liz

Matthew Fulmer wrote:

> On Wed, Oct 29, 2008 at 09:24:37AM -0400, liz wrote:
>  
>> Hi,
>>
>> There is probably a very obvious answer to this question...
>>
>> How does my Tweak object tell Croquet which events it wants to handle?
>>
>> For Croquet Objects such as TFrame I can set the eventMask.  I believe
>> the same is true for Morphic objects.  With Tweak I have played around
>> with methods such as handlesEvent: on both the costume and the object
>> and even though I set them to return false for things such as mousedown,
>> the mouse down event never gets passed on.
>>
>> I would like to have a Tweak object which I can click through and do
>> things in the Croquet Space.  If my Tweak object contains anything that
>> ever could handle mouse down (such as scroll pane in my case) even
>> though I override the handlesEvent: I cannot pass that mouse click on to
>> Croquet.
>>
>> What am I doing wrong?  Thanks in advance for any help,
>> Liz Wendland
>>
>>    
>
> Tweak does event handling completely different than Morphic or
> Croquet. You probably want one of these three methods:
>
> onClick
>     <on: mouseClick>
>     "Your code here"
>
> onMouseDown
>     <on: mouseDown>
>     "Your code here"
>
> onFire
>     <on: fire>
>     "Your code here"
>
> See these two pages:
>
> http://tweakproject.org/TECHNOLOGY/Tutorials/BankAccountTutorial/
> http://tweakproject.org/TECHNOLOGY/Documentation/PlayerEvents/
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: Tweak events

Tapple Gao
On Wed, Oct 29, 2008 at 12:22:47PM -0400, liz wrote:
> Hi Matthew,
>
> Thank your  for your reply.  I have used the Tweak event handling quite
> a bit and it is very nice.  My current problem is that I DO NOT want to
> handle these events and I want Tweak to pass them on to the Croquet
> environment.   I believe there is a way to indicate that certain events
> should be ignored, but I'm not sure how to do that from Tweak.

The only suggestion I have is to try tracing Tweak event
handling, and to look at CroquetHarnessWithMenu and friends

--
Matthew Fulmer -- http://mtfulmer.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: Tweak events

Phua Khai Fong
In reply to this post by Liz Wendland-2
Liz,

I think you will still need to handle the event in tweak but you handle it by passing the event to the T object that needs to handle the event. You can try holding a reference to the T object that you want to use to handle the event and pass the event from the Tweak object to the T object. I do a lot of this in freeCAD/Croquet but I'm not sure if what you want to achieve is the same. You can try looking at some of the window GUI though.


Liz Wendland-2 wrote
Hi Matthew,

Thank your  for your reply.  I have used the Tweak event handling quite
a bit and it is very nice.  My current problem is that I DO NOT want to
handle these events and I want Tweak to pass them on to the Croquet
environment.   I believe there is a way to indicate that certain events
should be ignored, but I'm not sure how to do that from Tweak.

Thanks!
Liz

Matthew Fulmer wrote:
> On Wed, Oct 29, 2008 at 09:24:37AM -0400, liz wrote:
>  
>> Hi,
>>
>> There is probably a very obvious answer to this question...
>>
>> How does my Tweak object tell Croquet which events it wants to handle?
>>
>> For Croquet Objects such as TFrame I can set the eventMask.  I believe
>> the same is true for Morphic objects.  With Tweak I have played around
>> with methods such as handlesEvent: on both the costume and the object
>> and even though I set them to return false for things such as mousedown,
>> the mouse down event never gets passed on.
>>
>> I would like to have a Tweak object which I can click through and do
>> things in the Croquet Space.  If my Tweak object contains anything that
>> ever could handle mouse down (such as scroll pane in my case) even
>> though I override the handlesEvent: I cannot pass that mouse click on to
>> Croquet.
>>
>> What am I doing wrong?  Thanks in advance for any help,
>> Liz Wendland
>>
>>    
>
> Tweak does event handling completely different than Morphic or
> Croquet. You probably want one of these three methods:
>
> onClick
>     <on: mouseClick>
>     "Your code here"
>
> onMouseDown
>     <on: mouseDown>
>     "Your code here"
>
> onFire
>     <on: fire>
>     "Your code here"
>
> See these two pages:
>
> http://tweakproject.org/TECHNOLOGY/Tutorials/BankAccountTutorial/
> http://tweakproject.org/TECHNOLOGY/Documentation/PlayerEvents/
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: Tweak events

Liz Wendland-2
Hi,

Thanks for the recommendations.  John Dougan helped me find a way to do
this... if you call:
 
myPlayer locked: true

for players you want to ignore events, the player will not be sent the
events and they will pass on to the next layer.  Exactly what I was
looking for.  I think what you are describing below, Fong, would work as
long as I know which object I want to pass the event to.  In my case I
don't.

Liz

Phua Khai Fong wrote:

> Liz,
>
> I think you will still need to handle the event in tweak but you handle it
> by passing the event to the T object that needs to handle the event. You can
> try holding a reference to the T object that you want to use to handle the
> event and pass the event from the Tweak object to the T object. I do a lot
> of this in freeCAD/Croquet but I'm not sure if what you want to achieve is
> the same. You can try looking at some of the window GUI though.
>
>
>
> Liz Wendland-2 wrote:
>  
>> Hi Matthew,
>>
>> Thank your  for your reply.  I have used the Tweak event handling quite
>> a bit and it is very nice.  My current problem is that I DO NOT want to
>> handle these events and I want Tweak to pass them on to the Croquet
>> environment.   I believe there is a way to indicate that certain events
>> should be ignored, but I'm not sure how to do that from Tweak.
>>
>> Thanks!
>> Liz
>>
>> Matthew Fulmer wrote:
>>    
>>> On Wed, Oct 29, 2008 at 09:24:37AM -0400, liz wrote:
>>>  
>>>      
>>>> Hi,
>>>>
>>>> There is probably a very obvious answer to this question...
>>>>
>>>> How does my Tweak object tell Croquet which events it wants to handle?
>>>>
>>>> For Croquet Objects such as TFrame I can set the eventMask.  I believe
>>>> the same is true for Morphic objects.  With Tweak I have played around
>>>> with methods such as handlesEvent: on both the costume and the object
>>>> and even though I set them to return false for things such as mousedown,
>>>> the mouse down event never gets passed on.
>>>>
>>>> I would like to have a Tweak object which I can click through and do
>>>> things in the Croquet Space.  If my Tweak object contains anything that
>>>> ever could handle mouse down (such as scroll pane in my case) even
>>>> though I override the handlesEvent: I cannot pass that mouse click on to
>>>> Croquet.
>>>>
>>>> What am I doing wrong?  Thanks in advance for any help,
>>>> Liz Wendland
>>>>
>>>>    
>>>>        
>>> Tweak does event handling completely different than Morphic or
>>> Croquet. You probably want one of these three methods:
>>>
>>> onClick
>>>     <on: mouseClick>
>>>     "Your code here"
>>>
>>> onMouseDown
>>>     <on: mouseDown>
>>>     "Your code here"
>>>
>>> onFire
>>>     <on: fire>
>>>     "Your code here"
>>>
>>> See these two pages:
>>>
>>> http://tweakproject.org/TECHNOLOGY/Tutorials/BankAccountTutorial/
>>> http://tweakproject.org/TECHNOLOGY/Documentation/PlayerEvents/
>>>
>>>  
>>>      
>>
>>    
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: Tweak events

Andreas.Raab
Hi Liz -

Locking the player is definitely one way to do it but it doesn't give
you much flexibility and won't allow you to add any interactive object
to that player. It works great if you (for example) want to use a
translucent overlay (for annotations etc) that really is ignoring all
the mouse events but it has limits.

I would not recommend doing this for the "main view", i.e, the main
display region of your application. In that case, I would strongly
recommend to hold a reference to the T-object (some kind of harness I
suppose?) and have the event handler forward the event explicitly.

Cheers,
   - Andreas

liz wrote:

> Hi,
>
> Thanks for the recommendations.  John Dougan helped me find a way to do
> this... if you call:
>
> myPlayer locked: true
>
> for players you want to ignore events, the player will not be sent the
> events and they will pass on to the next layer.  Exactly what I was
> looking for.  I think what you are describing below, Fong, would work as
> long as I know which object I want to pass the event to.  In my case I
> don't.
>
> Liz
>
> Phua Khai Fong wrote:
>> Liz,
>>
>> I think you will still need to handle the event in tweak but you
>> handle it
>> by passing the event to the T object that needs to handle the event.
>> You can
>> try holding a reference to the T object that you want to use to handle
>> the
>> event and pass the event from the Tweak object to the T object. I do a
>> lot
>> of this in freeCAD/Croquet but I'm not sure if what you want to
>> achieve is
>> the same. You can try looking at some of the window GUI though.
>>
>>
>>
>> Liz Wendland-2 wrote:
>>  
>>> Hi Matthew,
>>>
>>> Thank your  for your reply.  I have used the Tweak event handling
>>> quite a bit and it is very nice.  My current problem is that I DO NOT
>>> want to handle these events and I want Tweak to pass them on to the
>>> Croquet environment.   I believe there is a way to indicate that
>>> certain events should be ignored, but I'm not sure how to do that
>>> from Tweak.
>>>
>>> Thanks!
>>> Liz
>>>
>>> Matthew Fulmer wrote:
>>>    
>>>> On Wed, Oct 29, 2008 at 09:24:37AM -0400, liz wrote:
>>>>        
>>>>> Hi,
>>>>>
>>>>> There is probably a very obvious answer to this question...
>>>>>
>>>>> How does my Tweak object tell Croquet which events it wants to handle?
>>>>>
>>>>> For Croquet Objects such as TFrame I can set the eventMask.  I
>>>>> believe the same is true for Morphic objects.  With Tweak I have
>>>>> played around with methods such as handlesEvent: on both the
>>>>> costume and the object and even though I set them to return false
>>>>> for things such as mousedown, the mouse down event never gets
>>>>> passed on.
>>>>>
>>>>> I would like to have a Tweak object which I can click through and
>>>>> do things in the Croquet Space.  If my Tweak object contains
>>>>> anything that ever could handle mouse down (such as scroll pane in
>>>>> my case) even though I override the handlesEvent: I cannot pass
>>>>> that mouse click on to Croquet.
>>>>>
>>>>> What am I doing wrong?  Thanks in advance for any help,
>>>>> Liz Wendland
>>>>>
>>>>>            
>>>> Tweak does event handling completely different than Morphic or
>>>> Croquet. You probably want one of these three methods:
>>>>
>>>> onClick
>>>>     <on: mouseClick>
>>>>     "Your code here"
>>>>
>>>> onMouseDown
>>>>     <on: mouseDown>
>>>>     "Your code here"
>>>>
>>>> onFire
>>>>     <on: fire>
>>>>     "Your code here"
>>>>
>>>> See these two pages:
>>>>
>>>> http://tweakproject.org/TECHNOLOGY/Tutorials/BankAccountTutorial/
>>>> http://tweakproject.org/TECHNOLOGY/Documentation/PlayerEvents/
>>>>
>>>>        
>>>
>>>    
>>
>>  
>