on 5/12/05 10:55 AM, Alex Fischer at alex at basasoft dot com wrote:
> Tried to send it to the view with
> "SendEventToEventTargetWithOptions" but this produces a crash. Seems
> logic as it probably produces a infinite loop.
>
> Any ideas?
Could be that SendEventToEventTargetWithOptions should not be used, instead
try something like one or both of below functions, or adapt
SendEventToEventTargetWithOptions:
//used in the mousedown behavior function
static void _SendEventControlHitTest(REALcontrolInstance instance, Point pt)
{
ControlData(MyDefinition, instance, MyData, me);
EventRef theEvent;
CreateEvent(NULL, kEventClassControl, kEventControlHitTest, 0, 0,
&theEvent);
SetEventParameter(theEvent, kEventParamDirectObject, typeControlRef,
sizeof(ControlRef), &me->mHIViewRef);
SetEventParameter(theEvent, kEventParamMouseLocation, typeQDPoint,
sizeof(pt), &pt);
SendEventToEventTarget(theEvent, GetControlEventTarget(me->mHIViewRef));
ReleaseEvent(theEvent);
}
//used in the mousedown behavior function
static void _SendEventControlTrack(REALcontrolInstance instance, Point pt)
{
ControlData(MyDefinition, instance, MyData, me);
EventRef theEvent;
CreateEvent(NULL, kEventClassControl, kEventControlTrack, 0, 0,
&theEvent);
SetEventParameter(theEvent, kEventParamDirectObject, typeControlRef,
sizeof(ControlRef), &me->mHIViewRef);
SetEventParameter(theEvent, kEventParamMouseLocation, typeQDPoint,
sizeof(pt), &pt);
SendEventToEventTarget(theEvent, GetControlEventTarget(me->mHIViewRef));
ReleaseEvent(theEvent);
}
Alfred
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|