On Tue, Mar 4, 2014 at 1:13 PM, Nouvelle Collection <
[email protected]> wrote:

> Thanks for the explanations. You're right : there was a line missing here
> : I added EVT_FC_MOTION: {} in :
>
>     def MakeHitDict(self):
>         ##fixme: Should this just be None if nothing has been bound?
>         self.HitDict = {EVT_FC_LEFT_DOWN: {},
>                         EVT_FC_LEFT_UP: {},
>                         EVT_FC_LEFT_DCLICK: {},
>                          ...
>                         }
>
> and there is no more this KeyError.
>
> But the "motion event" is still not detected : do you think I should add
> something elsewhere ?
>

Hmm -- I guess I never added EVT_FC_MOTION, because I didn't think anyone
would want a mothnion event bound to an object -- they do have ENTER and
LEAVE events.

But I suppose if you have a large object, you may want to catch Motion
events on it....

So the problem is that the Mouse GUIMode isn't doing teh right thing with
passing the event on teh the HitTest code...

Looking at that now.

-Chris






> Jo
>
>
> 2014-03-04 18:25 GMT+01:00 Chris Barker <[email protected]>:
>
> I don;'t know why there is an error -- I'll see if I can look into that.
>>
>> But the KeyError related to color is because FloatCanvas uses colors to
>> do hit testing:
>>
>> each object is drawn to an off-screen bitmap in a unique color. When
>> there is a mouse event, the color of the pixel under the mouse is checked
>> to see what object is there. self.HitColor is the unique color of that
>> object (unrelated to the color drawn to teh screen for the user (if any).
>>
>> I actually think that the key error there is Event, rather than the
>> HitColor -- perhaps I forgot to add FC_MOTION to the HitDict....
>>
>> -Chris
>>
>
>
>
> _______________________________________________
> FloatCanvas mailing list
> [email protected]
> http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
>
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to