Added a virtual wxWindow::OSXGetViewOrWindow() method.
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
This commit is contained in:
@@ -237,6 +237,15 @@ public:
|
||||
// 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 ; }
|
||||
|
||||
|
Reference in New Issue
Block a user