Attaching user data to AXObserver

Posted by Ben Packard on Stack Overflow See other posts from Stack Overflow or by Ben Packard
Published on 2010-05-03T22:38:05Z Indexed on 2010/05/03 22:48 UTC
Read the original article Hit count: 267

Filed under:
|
|

I am using an AXObserver to monitor when a window is closed. In the callback, I am just raising an NSNotification. All working well.

What is the correct syntax for attaching some user data as refcon? The working call looks like this:

err6 = AXObserverAddNotification(observerTable, tableRef, kAXUIElementDestroyedNotification, nil);

and the callback specified when I create the observer has the signature:

static void cbTableClosed (AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void *refcon)

I want to replace refcon with an object of my own, but don't know how to change either line. The obvious objective-c type changes through up warnings.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about carbon