For which events are you registering?

Charles Yeomans



On May 2, 2007, at 1:15 PM, Daniel Stenning wrote:

> On 2/5/07 17:58, "Charles Yeomans" <[EMAIL PROTECTED]> wrote:
>
>> Offhand, I'm not sure that the code below would work.  For example,
>> you appear to be passing a nil Ptr as the last parameter to
>> InstallEventHandler.
>
> The carbon library declaration for the last parameter is ByRef so
> InstallEventHandler sets the pointer by reference.
>
>> I assume that CEventTypes is a struct,
> Correct
>
>> but I'm   not sure how that works, since you should be passing an  
>> array of
>> event types.
>
> It is a struct with a fixed number of eventtype elements ( I  
> realise I could
> have done this through a memoryblock but it seemed easier just to  
> use a
> struct holding a fixed array.
>
>
>> Does InstallEventHandler always return 0?
>
> Yes.
>>
>> Charles Yeomans
>>
>>
>> On May 2, 2007, at 12:45 PM, Daniel Stenning wrote:
>>
>>> I have in fact added the carbon event handler ( I just used the
>>> same code as
>>> used for the pure carbon version).
>>>
>>> Here is the main code for the "RB" window version which doesn't
>>> work ( it
>>> opens and the dylib paints the window correctly,l but the window
>>> fails to
>>> respond to any mouse events:
>>>
>>> <snick>
>>> //-----------------
>>>
>>> Function InstallCarbonEventHandler( editwinRef as WindowPtr )
>>>   Soft Declare Function InstallEventHandler Lib "Carbon"  (Target
>>> As Ptr,
>>> Handler as Ptr, EventTypeCount As integer,  ByRef evTypes As
>>> CEventTypes,
>>> userData As Ptr, ByRef outHandlerRef as Ptr) As Integer
>>>   Soft Declare Function GetWindowEventTarget Lib
>>> "Carbon"  (inWindow As
>>> WindowPtr) As Ptr
>>>
>>>   dim eventHandler as Ptr
>>>   dim evTypeCount as integer = 7//SetupCarbonEventTypes
>>> (CarbonEventTypes)
>>>   dim err as integer =  InstallEventHandler( GetWindowEventTarget(
>>> editwinRef ), AddressOf windowHandler, evTypeCount,  
>>> CarbonEventTypes ,
>>> plug.GetEffectPointer() , eventHandler )
>>>
>>>   Return eventHandler
>>> End Function
>>>
>>> //-----------------
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On 2/5/07 17:16, "Charles Yeomans" <[EMAIL PROTECTED]> wrote:
>>>
>>>> You might try adding a Carbon event handler to the window to handle
>>>> mouse events before the Rb code.  As I recall, event handlers  
>>>> form a
>>>> stack, so the last handler added gets first crack at the events for
>>>> which it has registered.  I've had mixed luck in taking control of
>>>> mouse events in windows via declares.
>>>>
>>>> Charles Yeomans
>>>>
>>>> On May 2, 2007, at 12:11 PM, Daniel Stenning wrote:
>>>
>>>
>>> _______________________________________________
>>> Unsubscribe or switch delivery mode:
>>> <http://www.realsoftware.com/support/listmanager/>
>>>
>>> Search the archives:
>>> <http://support.realsoftware.com/listarchives/lists.html>
>>
>> _______________________________________________
>> Unsubscribe or switch delivery mode:
>> <http://www.realsoftware.com/support/listmanager/>
>>
>> Search the archives:
>> <http://support.realsoftware.com/listarchives/lists.html>
>>
>
> Regards,
>
> Dan
>
>
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to