This can be used to retrieve either an NSView for child windows or NSWindow
for non-owned ones without resorting to dynamic casts.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62303
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxNonOwnedWindowImpl* GetNonOwnedPeer() const { return m_nowpeer; }
+#if wxOSX_USE_COCOA_OR_IPHONE
+ // override the base class method to return an NSWindow instead of NSView
+ virtual void *OSXGetViewOrWindow() const { return GetWXWindow(); }
+#endif // Cocoa
+
// osx specific event handling common for all osx-ports
virtual void HandleActivated( double timestampsec, bool didActivate );
// the 'true' OS level control for this wxWindow
wxOSXWidgetImpl* GetPeer() const { return m_peer ; }
+#if wxOSX_USE_COCOA_OR_IPHONE
+ // the NSView or NSWindow of this window: can be used for both child and
+ // non-owned windows
+ //
+ // this is useful for a few Cocoa function which can work with either views
+ // or windows indiscriminately, e.g. for setting NSViewAnimationTargetKey
+ virtual void *OSXGetViewOrWindow() const { return GetHandle(); }
+#endif // Cocoa
+
void * MacGetCGContextRef() { return m_cgContextRef ; }
void MacSetCGContextRef(void * cg) { m_cgContextRef = cg ; }