I’ve successfully added a Juce component to a native Mac window in another application (MaxMSP 4.6 actually) in a similar way to the VST/RTAS plugin code. i.e. something like:
juceWindowComp->setBounds(x, y + WINDOWTITLEBARHEIGHT, w, h); HIViewRef hiRoot = HIViewGetRoot(theWindow); juceWindowComp->addToDesktop(0, (void*)hiRoot);
This places the component (in which I have have just one slider) somewhere within the window. The component seems to get all the mousing activity, repaints itself etc. But it inhibits most of the other functionality of the window outside the bounds of the component. Mouse idling seems to work (though Max could be hacking that with a timer of course). Dragging doesn’t. I can add multiple instances to the same window and these all seem to work.
The window doesn’t appear to be compositing (checked the kWindowCompositingAttribute) so I assume that the HIViewFindByID / kHIViewWindowCotentID method won’t work (well I tried and the component doesn’t display itself). The GetRootControl / CreateRootControl method displays the component but doesn’t appear to receive mousing info (and still breaks the remainder of the window as when I add the component to the root).
Any obvious things I should try before giving up?
What would simplest, I guess, is if I can get the component to render into the window but not grab mouse info (and I’ll pass this in myself from the host).