Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling TransitionWindowWithOptions on a WindowRef returned from a [NSWindow windowRef]



Hi all,
-windowRef is intended to create a Carbon window reference for a Cocoa window, to allow two things. One is using a Cocoa window in a Carbon app - the Cocoa window needs a windowRef so that Carbon can communicate with it. The other is hosting a specific Carbon control, but this is only supported for Carbon controls wrapped by Cocoa, like NSQuickDrawView and NSMovieView. These are the areas that we have tested, but a general Cocoa window in a Carbon app remains only partially supported. We have worked to improve that, but there are still problems. As Eric mentioned previously, it is generally best to use the "native" API on a window, and it is the exception rather than the rule for Carbon API to work on a Cocoa window, or vice versa.


-windowRef *can* be used on windows that are created with - initWithWindowRef:, but that was not its original reason for being.

I agree that the documentation should be made more clear, and have filed a bug to do so.

Thanks,
Kristin


On Feb 9, 2006, at 4:14 PM, Ricky Sharp wrote:


On Feb 9, 2006, at 5:31 PM, Matt Gough wrote:

OK, so to put it another way. What is [NSWindow windowRef] really intended for. The documentation is a bit vague and misleading:

****

Discussion

This method can be used to create a WindowRef for a window containing a Carbon control. Subsequent calls to this method return the existing WindowRef.

I would have thought it was just an accessor to get the windowRef you passed in to the initWithWindowRef. This makes it sound like it's possible to obtain a WindowRef from an NSWindow such that you didn't call initWithWindowRef.


For more information see MacWindows.h.

****

Is it really only intended to be used on NSWindows that were created using [NSWindow initWithWindowRef:], and as such are 'real' Carbon windows with an NSWindow wrapper.

As far as I know, it is not possible to have a genuine Cocoa NSWindow with 'a Carbon control'.

If it's truly the case where the windowRef API can only ever be used on instances where you did initWithWindowRef:, then a documentation enhancement should be filed to clear that up.



___________________________________________________________ Ricky A. Sharp mailto:email@hidden Instant Interactive(tm) http://www.instantinteractive.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Calling TransitionWindowWithOptions on a WindowRef returned from a [NSWindow windowRef] (From: Dave MacLachlan <email@hidden>)
 >Re: Calling TransitionWindowWithOptions on a WindowRef returned from a [NSWindow windowRef] (From: Eric Schlegel <email@hidden>)
 >Re: Calling TransitionWindowWithOptions on a WindowRef returned from a [NSWindow windowRef] (From: Matt Gough <email@hidden>)
 >Re: Calling TransitionWindowWithOptions on a WindowRef returned from a [NSWindow windowRef] (From: Eric Schlegel <email@hidden>)
 >Re: Calling TransitionWindowWithOptions on a WindowRef returned from a [NSWindow windowRef] (From: Matt Gough <email@hidden>)
 >Re: Calling TransitionWindowWithOptions on a WindowRef returned from a [NSWindow windowRef] (From: Ricky Sharp <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.