[Interest] NSView inside Carbon Window

René J.V. Bertin rjvbertin at gmail.com
Mon Jun 8 12:36:09 CEST 2015


On Monday June 08 2015 09:24:56 Nuno Santos wrote:

Hi Nuno:

> I'm trying to instantiate a QWindow inside a Carbon WindowRef, but 
> QWindow fromWid method needs a NSView to be passed by parameter and not 
> a WindowRef.
> 
> I have seen been saying that it is not possible to have a NSView inside 
> a CarbonWindow. Maybe someone more experienced in Mac OSX architecture 
> could confirm me this.

Try this:

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/index.html#//apple_ref/occ/instm/NSWindow/initWithWindowRef:

Then you send a contentView message to the NSWindow instance you got. Note that that gives you "the window’s content view, the highest accessible NSView object in the window’s view hierarchy." If that's not the one you need, you'll have to figure out how to get the subviews (answer via google!) and pick the right one.

R.





More information about the Interest mailing list