realbasic-plugins
[Top] [All Lists]

Re: WebKit plugin

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: WebKit plugin
From: Alfred Van Hoek <vanhoek at mac dot com>
Date: Thu, 12 May 2005 11:42:54 -0400
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
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>

<Prev in Thread] Current Thread [Next in Thread>