Forums > Dev

how to get a WindowRef

January 16, 2007 | 8:07 pm

Recently I was trying to write an external that could load QuartComposer patches and directly interact with their published ports.

I successfully succeed in loading a few ones but I’m currently using a quick and dirty hack which consist of grabbing the main screen as described here:

http://developer.apple.com/documentation/GraphicsImaging/Conceptual/QuartzComposer/qc_play_renderer/chapter_6_section_4.html#//apple_ref/doc/uid/TP40001357-CH209-BAJIDAHB

but it never gives it back…

Now I’d like to do it properly and for that I need to be able to wrap a WindowRef as a NSWindow.

So the question is how to properly create a window and get a WindowRef with the MaxMSP API?


January 16, 2007 | 9:35 pm

On Jan 16, 2007, at 12:07 PM, remy muller wrote:

> So the question is how to properly create a window and get a
> WindowRef with the MaxMSP API?

Use wind_new() to create the window. Then use wind_syswind() to get
the WindowPtr (which is what t_syswind is defined to be on Mac)

t_syswind wind_syswind(t_wind *x);

Hope this helps.

-Joshua


January 16, 2007 | 10:32 pm

thanks,

I’ll let you know how far I get.


January 17, 2007 | 11:31 am

thanks again for pointing me in the right direction, I can now have a working NSWindow with a QCView inside it out of a t_wind.

I’m still not finished yet, but now it’s only QuartzComposer/ObjectiveC related.


Viewing 4 posts - 1 through 4 (of 4 total)