1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/cocoa/nonownedwnd.mm
3 // Purpose: non owned window for cocoa
4 // Author: DavidStefan Csomor
7 // RCS-ID: $Id: nonownedwnd.mm 48805 2007-09-19 14:52:25Z SC $
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
14 #include "wx/nonownedwnd.h"
19 #include "wx/osx/private.h"
21 NSRect wxToNSRect( NSView* parent, const wxRect& r )
23 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
26 if ( parent == NULL || ![ parent isFlipped ] )
27 y = (int)(frame.size.height - ( r.y + r.height ));
28 return NSMakeRect(x, y, r.width , r.height);
31 wxRect wxFromNSRect( NSView* parent, const NSRect& rect )
33 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
34 int y = (int)rect.origin.y;
35 int x = (int)rect.origin.x;
36 if ( parent == NULL || ![ parent isFlipped ] )
37 y = (int)(frame.size.height - (rect.origin.y + rect.size.height));
38 return wxRect( x, y, (int)rect.size.width, (int)rect.size.height );
41 NSPoint wxToNSPoint( NSView* parent, const wxPoint& p )
43 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
46 if ( parent == NULL || ![ parent isFlipped ] )
47 y = (int)(frame.size.height - ( p.y ));
48 return NSMakePoint(x, y);
51 wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p )
53 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
56 if ( parent == NULL || ![ parent isFlipped ] )
57 y = (int)(frame.size.height - ( p.y ));
58 return wxPoint( x, y);
61 bool shouldHandleSelector(SEL selector)
63 if (selector == @selector(noop:)
64 || selector == @selector(complete:)
65 || selector == @selector(deleteBackward:)
66 || selector == @selector(deleteForward:)
67 || selector == @selector(insertNewline:)
68 || selector == @selector(insertTab:)
69 || selector == @selector(keyDown:)
70 || selector == @selector(keyUp:)
71 || selector == @selector(scrollPageUp:)
72 || selector == @selector(scrollPageDown:)
73 || selector == @selector(scrollToBeginningOfDocument:)
74 || selector == @selector(scrollToEndOfDocument:))
82 // wx category for NSWindow (our own and wrapped instances)
85 @interface NSWindow (wxNSWindowSupport)
87 - (wxNonOwnedWindowCocoaImpl*) WX_implementation;
89 - (bool) WX_filterSendEvent:(NSEvent *) event;
93 @implementation NSWindow (wxNSWindowSupport)
95 - (wxNonOwnedWindowCocoaImpl*) WX_implementation
97 return (wxNonOwnedWindowCocoaImpl*) wxNonOwnedWindowImpl::FindFromWXWindow( self );
100 // TODO in cocoa everything during a drag is sent to the NSWindow the mouse down occured,
101 // this does not conform to the wx behaviour if the window is not captured, so try to resend
102 // or capture all wx mouse event handling at the tlw as we did for carbon
104 - (bool) WX_filterSendEvent:(NSEvent *) event
106 bool handled = false;
107 if ( ([event type] >= NSLeftMouseDown) && ([event type] <= NSMouseExited) )
109 wxWindow* cw = wxWindow::GetCapture();
112 ((wxWidgetCocoaImpl*)cw->GetPeer())->DoHandleMouseEvent( event);
121 // wx native implementation
124 @interface wxNSWindow : NSWindow
128 - (void) sendEvent:(NSEvent *)event;
129 - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen;
130 - (void)noResponderFor: (SEL) selector;
133 @implementation wxNSWindow
135 - (void)sendEvent:(NSEvent *) event
137 if ( ![self WX_filterSendEvent: event] )
139 WXEVENTREF formerEvent = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEvent();
140 WXEVENTHANDLERCALLREF formerHandler = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEventHandlerCallRef();
143 wxTheApp->MacSetCurrentEvent(event, NULL);
145 [super sendEvent: event];
148 wxTheApp->MacSetCurrentEvent(formerEvent , formerHandler);
152 // The default implementation always moves the window back onto the screen,
153 // even when the programmer explicitly wants to hide it.
154 - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
160 - (void)doCommandBySelector:(SEL)selector
162 if (shouldHandleSelector(selector) &&
163 !(selector == @selector(cancel:) || selector == @selector(cancelOperation:)) )
164 [super doCommandBySelector:selector];
168 // NB: if we don't do this, all key downs that get handled lead to a NSBeep
169 - (void)noResponderFor: (SEL) selector
171 if (selector != @selector(keyDown:) && selector != @selector(keyUp:))
173 [super noResponderFor:selector];
177 // We need this for borderless windows, i.e. shaped windows or windows without
178 // a title bar. For more info, see:
179 // http://lists.apple.com/archives/cocoa-dev/2008/May/msg02091.html
180 - (BOOL)canBecomeKeyWindow
187 @interface wxNSPanel : NSPanel
191 - (void)noResponderFor: (SEL) selector;
192 - (void)sendEvent:(NSEvent *)event;
195 @implementation wxNSPanel
197 - (BOOL)canBecomeKeyWindow
202 - (void)doCommandBySelector:(SEL)selector
204 if (shouldHandleSelector(selector))
205 [super doCommandBySelector:selector];
208 // NB: if we don't do this, it seems that all events that end here lead to a NSBeep
209 - (void)noResponderFor: (SEL) selector
211 if (selector != @selector(keyDown:) && selector != @selector(keyUp:))
213 [super noResponderFor:selector];
217 - (void)sendEvent:(NSEvent *) event
219 if ( ![self WX_filterSendEvent: event] )
220 [super sendEvent: event];
230 @interface wxNonOwnedWindowController : NSObject wxOSX_10_6_AND_LATER(<NSWindowDelegate>)
234 - (void)windowDidResize:(NSNotification *)notification;
235 - (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize;
236 - (void)windowDidResignKey:(NSNotification *)notification;
237 - (void)windowDidBecomeKey:(NSNotification *)notification;
238 - (void)windowDidMove:(NSNotification *)notification;
239 - (BOOL)windowShouldClose:(id)window;
240 - (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame;
244 @implementation wxNonOwnedWindowController
252 - (BOOL)windowShouldClose:(id)nwindow
254 wxNonOwnedWindowCocoaImpl* windowimpl = [(NSWindow*) nwindow WX_implementation];
257 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
264 - (NSSize)windowWillResize:(NSWindow *)window
265 toSize:(NSSize)proposedFrameSize
267 NSRect frame = [window frame];
268 wxRect wxframe = wxFromNSRect( NULL, frame );
269 wxframe.SetWidth( (int)proposedFrameSize.width );
270 wxframe.SetHeight( (int)proposedFrameSize.height );
272 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
275 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
278 wxpeer->HandleResizing( 0, &wxframe );
279 NSSize newSize = NSMakeSize(wxframe.GetWidth(), wxframe.GetHeight());
284 return proposedFrameSize;
287 - (void)windowDidResize:(NSNotification *)notification
289 NSWindow* window = (NSWindow*) [notification object];
290 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
293 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
295 wxpeer->HandleResized(0);
299 - (void)windowDidMove:(NSNotification *)notification
301 wxNSWindow* window = (wxNSWindow*) [notification object];
302 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
305 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
307 wxpeer->HandleMoved(0);
311 - (void)windowDidBecomeKey:(NSNotification *)notification
313 NSWindow* window = (NSWindow*) [notification object];
314 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
317 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
319 wxpeer->HandleActivated(0, true);
323 - (void)windowDidResignKey:(NSNotification *)notification
325 NSWindow* window = (NSWindow*) [notification object];
326 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
329 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
332 wxpeer->HandleActivated(0, false);
333 // Needed for popup window since the firstResponder
334 // (focus in wx) doesn't change when this
335 // TLW becomes inactive.
336 wxFocusEvent event( wxEVT_KILL_FOCUS, wxpeer->GetId());
337 event.SetEventObject(wxpeer);
338 wxpeer->HandleWindowEvent(event);
343 - (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)anObject
347 if ([anObject isKindOfClass:[wxNSTextField class]])
349 wxNSTextField* tf = (wxNSTextField*) anObject;
350 wxNSTextFieldEditor* editor = [tf fieldEditor];
353 editor = [[wxNSTextFieldEditor alloc] init];
354 [editor setFieldEditor:YES];
355 [tf setFieldEditor:editor];
363 - (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame
365 wxUnusedVar(newFrame);
366 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
369 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
370 wxMaximizeEvent event(wxpeer->GetId());
371 event.SetEventObject(wxpeer);
372 return !wxpeer->HandleWindowEvent(event);
379 IMPLEMENT_DYNAMIC_CLASS( wxNonOwnedWindowCocoaImpl , wxNonOwnedWindowImpl )
381 wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl( wxNonOwnedWindow* nonownedwnd) :
382 wxNonOwnedWindowImpl(nonownedwnd)
385 m_macFullScreenData = NULL;
388 wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl()
391 m_macFullScreenData = NULL;
394 wxNonOwnedWindowCocoaImpl::~wxNonOwnedWindowCocoaImpl()
396 if ( !m_wxPeer->IsNativeWindowWrapper() )
398 [m_macWindow setDelegate:nil];
399 [m_macWindow release];
403 void wxNonOwnedWindowCocoaImpl::WillBeDestroyed()
405 if ( !m_wxPeer->IsNativeWindowWrapper() )
407 [m_macWindow setDelegate:nil];
411 void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), const wxPoint& pos, const wxSize& size,
412 long style, long extraStyle, const wxString& WXUNUSED(name) )
414 static wxNonOwnedWindowController* controller = NULL;
417 controller =[[wxNonOwnedWindowController alloc] init];
420 int windowstyle = NSBorderlessWindowMask;
422 if ( style & wxFRAME_TOOL_WINDOW || ( style & wxPOPUP_WINDOW ) ||
423 GetWXPeer()->GetExtraStyle() & wxTOPLEVEL_EX_DIALOG )
425 m_macWindow = [wxNSPanel alloc];
428 m_macWindow = [wxNSWindow alloc];
430 CGWindowLevel level = kCGNormalWindowLevel;
432 if ( style & wxFRAME_TOOL_WINDOW )
434 windowstyle |= NSUtilityWindowMask;
435 if ( ( style & wxMINIMIZE_BOX ) || ( style & wxMAXIMIZE_BOX ) ||
436 ( style & wxCLOSE_BOX ) || ( style & wxSYSTEM_MENU ) )
438 windowstyle |= NSTitledWindowMask ;
441 else if ( ( style & wxPOPUP_WINDOW ) )
443 level = kCGPopUpMenuWindowLevel;
445 if ( ( style & wxBORDER_NONE ) )
447 wclass = kHelpWindowClass ; // has no border
448 attr |= kWindowNoShadowAttribute;
452 wclass = kPlainWindowClass ; // has a single line border, it will have to do for now
456 else if ( ( style & wxCAPTION ) )
458 windowstyle |= NSTitledWindowMask ;
460 else if ( ( style & wxFRAME_DRAWER ) )
463 wclass = kDrawerWindowClass;
468 // set these even if we have no title, otherwise the controls won't be visible
469 if ( ( style & wxMINIMIZE_BOX ) || ( style & wxMAXIMIZE_BOX ) ||
470 ( style & wxCLOSE_BOX ) || ( style & wxSYSTEM_MENU ) )
472 windowstyle |= NSTitledWindowMask ;
475 else if ( ( style & wxNO_BORDER ) )
477 wclass = kSimpleWindowClass ;
481 wclass = kPlainWindowClass ;
486 if ( windowstyle & NSTitledWindowMask )
488 if ( ( style & wxMINIMIZE_BOX ) )
489 windowstyle |= NSMiniaturizableWindowMask ;
491 if ( ( style & wxMAXIMIZE_BOX ) )
492 windowstyle |= NSResizableWindowMask ; // TODO showing ZOOM ?
494 if ( ( style & wxRESIZE_BORDER ) )
495 windowstyle |= NSResizableWindowMask ;
497 if ( ( style & wxCLOSE_BOX) )
498 windowstyle |= NSClosableWindowMask ;
500 if ( extraStyle & wxFRAME_EX_METAL)
501 windowstyle |= NSTexturedBackgroundWindowMask;
503 if ( ( style & wxFRAME_FLOAT_ON_PARENT ) || ( style & wxFRAME_TOOL_WINDOW ) )
504 level = kCGFloatingWindowLevel;
506 if ( ( style & wxSTAY_ON_TOP ) )
507 level = kCGUtilityWindowLevel;
509 NSRect r = wxToNSRect( NULL, wxRect( pos, size) );
511 r = [NSWindow contentRectForFrameRect:r styleMask:windowstyle];
513 [m_macWindow initWithContentRect:r
514 styleMask:windowstyle
515 backing:NSBackingStoreBuffered
519 [m_macWindow setLevel:level];
521 [m_macWindow setDelegate:controller];
523 [m_macWindow setAcceptsMouseMovedEvents: YES];
525 if ( ( style & wxFRAME_SHAPED) )
527 [m_macWindow setOpaque:NO];
528 [m_macWindow setAlphaValue:1.0];
532 void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), WXWindow nativeWindow )
534 m_macWindow = nativeWindow;
537 WXWindow wxNonOwnedWindowCocoaImpl::GetWXWindow() const
542 void wxNonOwnedWindowCocoaImpl::Raise()
544 [m_macWindow orderWindow:NSWindowAbove relativeTo:0];
547 void wxNonOwnedWindowCocoaImpl::Lower()
549 [m_macWindow orderWindow:NSWindowBelow relativeTo:0];
552 void wxNonOwnedWindowCocoaImpl::ShowWithoutActivating()
554 [m_macWindow orderFront:nil];
555 [[m_macWindow contentView] setNeedsDisplay: YES];
558 bool wxNonOwnedWindowCocoaImpl::Show(bool show)
562 wxNonOwnedWindow* wxpeer = GetWXPeer();
563 if (wxpeer && !(wxpeer->GetWindowStyle() & wxFRAME_TOOL_WINDOW))
564 [m_macWindow makeKeyAndOrderFront:nil];
566 [m_macWindow orderFront:nil];
567 [[m_macWindow contentView] setNeedsDisplay: YES];
570 [m_macWindow orderOut:nil];
574 bool wxNonOwnedWindowCocoaImpl::ShowWithEffect(bool show,
578 return wxWidgetCocoaImpl::
579 ShowViewOrWindowWithEffect(m_wxPeer, show, effect, timeout);
582 void wxNonOwnedWindowCocoaImpl::Update()
584 [m_macWindow displayIfNeeded];
587 bool wxNonOwnedWindowCocoaImpl::SetTransparent(wxByte alpha)
589 [m_macWindow setAlphaValue:(CGFloat) alpha/255.0];
593 bool wxNonOwnedWindowCocoaImpl::SetBackgroundColour(const wxColour& WXUNUSED(col) )
598 void wxNonOwnedWindowCocoaImpl::SetExtraStyle( long exStyle )
602 bool metal = exStyle & wxFRAME_EX_METAL ;
603 int windowStyle = [ m_macWindow styleMask];
604 if ( metal && !(windowStyle & NSTexturedBackgroundWindowMask) )
606 wxFAIL_MSG( wxT("Metal Style cannot be changed after creation") );
608 else if ( !metal && (windowStyle & NSTexturedBackgroundWindowMask ) )
610 wxFAIL_MSG( wxT("Metal Style cannot be changed after creation") );
615 void wxNonOwnedWindowCocoaImpl::SetWindowStyleFlag( long style )
619 CGWindowLevel level = kCGNormalWindowLevel;
621 if (style & wxSTAY_ON_TOP)
622 level = kCGUtilityWindowLevel;
623 else if (( style & wxFRAME_FLOAT_ON_PARENT ) || ( style & wxFRAME_TOOL_WINDOW ))
624 level = kCGFloatingWindowLevel;
626 [m_macWindow setLevel: level];
630 bool wxNonOwnedWindowCocoaImpl::SetBackgroundStyle(wxBackgroundStyle style)
632 if ( style == wxBG_STYLE_TRANSPARENT )
634 [m_macWindow setOpaque:NO];
635 [m_macWindow setBackgroundColor:[NSColor clearColor]];
641 bool wxNonOwnedWindowCocoaImpl::CanSetTransparent()
646 void wxNonOwnedWindowCocoaImpl::MoveWindow(int x, int y, int width, int height)
648 NSRect r = wxToNSRect( NULL, wxRect(x,y,width, height) );
649 // do not trigger refreshes upon invisible and possible partly created objects
650 [m_macWindow setFrame:r display:GetWXPeer()->IsShownOnScreen()];
653 void wxNonOwnedWindowCocoaImpl::GetPosition( int &x, int &y ) const
655 wxRect r = wxFromNSRect( NULL, [m_macWindow frame] );
660 void wxNonOwnedWindowCocoaImpl::GetSize( int &width, int &height ) const
662 NSRect rect = [m_macWindow frame];
663 width = (int)rect.size.width;
664 height = (int)rect.size.height;
667 void wxNonOwnedWindowCocoaImpl::GetContentArea( int& left, int &top, int &width, int &height ) const
669 NSRect outer = NSMakeRect(100,100,100,100);
670 NSRect content = [NSWindow contentRectForFrameRect:outer styleMask:[m_macWindow styleMask] ];
671 NSRect rect = [[m_macWindow contentView] frame];
672 left = (int)rect.origin.x;
673 top = (int)rect.origin.y;
674 width = (int)rect.size.width;
675 height = (int)rect.size.height;
678 bool wxNonOwnedWindowCocoaImpl::SetShape(const wxRegion& WXUNUSED(region))
680 [m_macWindow setOpaque:NO];
681 [m_macWindow setBackgroundColor:[NSColor clearColor]];
686 void wxNonOwnedWindowCocoaImpl::SetTitle( const wxString& title, wxFontEncoding encoding )
688 [m_macWindow setTitle:wxCFStringRef( title , encoding ).AsNSString()];
691 bool wxNonOwnedWindowCocoaImpl::IsMaximized() const
693 if (([m_macWindow styleMask] & NSResizableWindowMask) != 0)
695 return [m_macWindow isZoomed];
699 NSRect rectScreen = [[NSScreen mainScreen] visibleFrame];
700 NSRect rectWindow = [m_macWindow frame];
701 return (rectScreen.origin.x == rectWindow.origin.x &&
702 rectScreen.origin.y == rectWindow.origin.y &&
703 rectScreen.size.width == rectWindow.size.width &&
704 rectScreen.size.height == rectWindow.size.height);
708 bool wxNonOwnedWindowCocoaImpl::IsIconized() const
710 return [m_macWindow isMiniaturized];
713 void wxNonOwnedWindowCocoaImpl::Iconize( bool iconize )
716 [m_macWindow miniaturize:nil];
718 [m_macWindow deminiaturize:nil];
721 void wxNonOwnedWindowCocoaImpl::Maximize(bool WXUNUSED(maximize))
723 [m_macWindow zoom:nil];
727 // http://cocoadevcentral.com/articles/000028.php
732 NSRect m_formerFrame;
735 bool wxNonOwnedWindowCocoaImpl::IsFullScreen() const
737 return m_macFullScreenData != NULL ;
740 bool wxNonOwnedWindowCocoaImpl::ShowFullScreen(bool show, long WXUNUSED(style))
744 FullScreenData *data = (FullScreenData *)m_macFullScreenData ;
746 data = new FullScreenData();
748 m_macFullScreenData = data ;
749 data->m_formerLevel = [m_macWindow level];
750 data->m_formerFrame = [m_macWindow frame];
751 CGDisplayCapture( kCGDirectMainDisplay );
752 [m_macWindow setLevel:CGShieldingWindowLevel()];
753 [m_macWindow setFrame:[[NSScreen mainScreen] frame] display:YES];
755 else if ( m_macFullScreenData != NULL )
757 FullScreenData *data = (FullScreenData *) m_macFullScreenData ;
758 CGDisplayRelease( kCGDirectMainDisplay );
759 [m_macWindow setLevel:data->m_formerLevel];
760 [m_macWindow setFrame:data->m_formerFrame display:YES];
762 m_macFullScreenData = NULL ;
768 void wxNonOwnedWindowCocoaImpl::RequestUserAttention(int flagsWX)
770 NSRequestUserAttentionType flagsOSX;
773 case wxUSER_ATTENTION_INFO:
774 flagsOSX = NSInformationalRequest;
777 case wxUSER_ATTENTION_ERROR:
778 flagsOSX = NSCriticalRequest;
782 wxFAIL_MSG( "invalid RequestUserAttention() flags" );
786 [NSApp requestUserAttention:flagsOSX];
789 void wxNonOwnedWindowCocoaImpl::ScreenToWindow( int *x, int *y )
791 wxPoint p((x ? *x : 0), (y ? *y : 0) );
792 NSPoint nspt = wxToNSPoint( NULL, p );
793 nspt = [m_macWindow convertScreenToBase:nspt];
794 nspt = [[m_macWindow contentView] convertPoint:nspt fromView:nil];
795 p = wxFromNSPoint([m_macWindow contentView], nspt);
802 void wxNonOwnedWindowCocoaImpl::WindowToScreen( int *x, int *y )
804 wxPoint p((x ? *x : 0), (y ? *y : 0) );
805 NSPoint nspt = wxToNSPoint( [m_macWindow contentView], p );
806 nspt = [[m_macWindow contentView] convertPoint:nspt toView:nil];
807 nspt = [m_macWindow convertBaseToScreen:nspt];
808 p = wxFromNSPoint( NULL, nspt);
815 bool wxNonOwnedWindowCocoaImpl::IsActive()
817 return [m_macWindow isKeyWindow];
820 void wxNonOwnedWindowCocoaImpl::SetModified(bool modified)
822 [m_macWindow setDocumentEdited:modified];
825 bool wxNonOwnedWindowCocoaImpl::IsModified() const
827 return [m_macWindow isDocumentEdited];
830 wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, WXWindow nativeWindow)
832 wxNonOwnedWindowCocoaImpl* now = new wxNonOwnedWindowCocoaImpl( wxpeer );
833 now->Create( parent, nativeWindow );
837 wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
838 long style, long extraStyle, const wxString& name )
840 wxNonOwnedWindowImpl* now = new wxNonOwnedWindowCocoaImpl( wxpeer );
841 now->Create( parent, pos, size, style , extraStyle, name );