On Nov 17, 2003, at 7:44 PM, Alexander Cohen wrote:
Hi, i need to implement my own HIWebViewCreate to get access to a
subclass of WebView that i created in cocoa. Is there anything special
going on in that routine that i should no about. My implementation is
returning an invalid control handle each time. Im really doing nothing
special. I have a obj-c class that has a super of WebView, no data,
and an overloaded -(void)mouseDown. From the custom call that i write
in my bundle to access this from Carbon, i just alloc my new subclass,
send it an init message, and assign my object to a pointer to a
HIViewRef that i pass. This shiould work right?
No... I don't think that will work.
A HIViewRef is the same as a NSView*? I always get an invalid control,
what might i be doing wrong?
I don't think this is true. The HIViewRef that you get back from
HIWebViewCreate is not a direct pointer to the NSView. It is an opaque
data structure whose contents are (by definition) not available to the
programmer. My strong suspicion is that somewhere in that opaque
HIView is a reference to the original NSView, but the HIViewRef and the
NSView * are two different things.
I do not believe there is any way to create a subclass of a web view
that you can get at from Carbon.