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"
18 #include "wx/osx/private.h"
20 NSRect wxToNSRect( NSView* parent, const wxRect& r )
22 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
25 if ( parent == NULL || ![ parent isFlipped ] )
26 y = (int)(frame.size.height - ( r.y + r.height ));
27 return NSMakeRect(x, y, r.width , r.height);
30 wxRect wxFromNSRect( NSView* parent, const NSRect& rect )
32 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
33 int y = (int)rect.origin.y;
34 int x = (int)rect.origin.x;
35 if ( parent == NULL || ![ parent isFlipped ] )
36 y = (int)(frame.size.height - (rect.origin.y + rect.size.height));
37 return wxRect( x, y, (int)rect.size.width, (int)rect.size.height );
40 NSPoint wxToNSPoint( NSView* parent, const wxPoint& p )
42 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
45 if ( parent == NULL || ![ parent isFlipped ] )
46 y = (int)(frame.size.height - ( p.y ));
47 return NSMakePoint(x, y);
50 wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p )
52 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
55 if ( parent == NULL || ![ parent isFlipped ] )
56 y = (int)(frame.size.height - ( p.y ));
57 return wxPoint( x, y);
60 bool shouldHandleSelector(SEL selector)
62 if (selector == @selector(noop:)
63 || selector == @selector(complete:)
64 || selector == @selector(deleteBackward:)
65 || selector == @selector(deleteForward:)
66 || selector == @selector(insertNewline:)
67 || selector == @selector(insertTab:)
68 || selector == @selector(keyDown:)
69 || selector == @selector(keyUp:)
70 || selector == @selector(scrollPageUp:)
71 || selector == @selector(scrollPageDown:)
72 || selector == @selector(scrollToBeginningOfDocument:)
73 || selector == @selector(scrollToEndOfDocument:))
81 // wx category for NSWindow (our own and wrapped instances)
84 @interface NSWindow (wxNSWindowSupport)
86 - (wxNonOwnedWindowCocoaImpl*) WX_implementation;
88 - (bool) WX_filterSendEvent:(NSEvent *) event;
92 @implementation NSWindow (wxNSWindowSupport)
94 - (wxNonOwnedWindowCocoaImpl*) WX_implementation
96 return (wxNonOwnedWindowCocoaImpl*) wxNonOwnedWindowImpl::FindFromWXWindow( self );
99 // TODO in cocoa everything during a drag is sent to the NSWindow the mouse down occured,
100 // this does not conform to the wx behaviour if the window is not captured, so try to resend
101 // or capture all wx mouse event handling at the tlw as we did for carbon
103 - (bool) WX_filterSendEvent:(NSEvent *) event
105 bool handled = false;
106 if ( ([event type] >= NSLeftMouseDown) && ([event type] <= NSMouseExited) )
108 wxWindow* cw = wxWindow::GetCapture();
111 ((wxWidgetCocoaImpl*)cw->GetPeer())->DoHandleMouseEvent( event);
120 // wx native implementation
123 @interface wxNSWindow : NSWindow
127 - (void) sendEvent:(NSEvent *)event;
128 - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen;
129 - (void)noResponderFor: (SEL) selector;
132 @implementation wxNSWindow
134 - (void)sendEvent:(NSEvent *) event
136 if ( ![self WX_filterSendEvent: event] )
138 WXEVENTREF formerEvent = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEvent();
139 WXEVENTHANDLERCALLREF formerHandler = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEventHandlerCallRef();
142 wxTheApp->MacSetCurrentEvent(event, NULL);
144 [super sendEvent: event];
147 wxTheApp->MacSetCurrentEvent(formerEvent , formerHandler);
151 // The default implementation always moves the window back onto the screen,
152 // even when the programmer explicitly wants to hide it.
153 - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
159 - (void)doCommandBySelector:(SEL)selector
161 if (shouldHandleSelector(selector) &&
162 !(selector == @selector(cancel:) || selector == @selector(cancelOperation:)) )
163 [super doCommandBySelector:selector];
167 // NB: if we don't do this, all key downs that get handled lead to a NSBeep
168 - (void)noResponderFor: (SEL) selector
170 if (selector != @selector(keyDown:) && selector != @selector(keyUp:))
172 [super noResponderFor:selector];
176 // We need this for borderless windows, i.e. shaped windows or windows without
177 // a title bar. For more info, see:
178 // http://lists.apple.com/archives/cocoa-dev/2008/May/msg02091.html
179 - (BOOL)canBecomeKeyWindow
186 @interface wxNSPanel : NSPanel
190 - (void)noResponderFor: (SEL) selector;
191 - (void)sendEvent:(NSEvent *)event;
194 @implementation wxNSPanel
196 - (BOOL)canBecomeKeyWindow
201 - (void)doCommandBySelector:(SEL)selector
203 if (shouldHandleSelector(selector))
204 [super doCommandBySelector:selector];
207 // NB: if we don't do this, it seems that all events that end here lead to a NSBeep
208 - (void)noResponderFor: (SEL) selector
210 if (selector != @selector(keyDown:) && selector != @selector(keyUp:))
212 [super noResponderFor:selector];
216 - (void)sendEvent:(NSEvent *) event
218 if ( ![self WX_filterSendEvent: event] )
219 [super sendEvent: event];
229 @interface wxNonOwnedWindowController : NSObject wxOSX_10_6_AND_LATER(<NSWindowDelegate>)
233 - (void)windowDidResize:(NSNotification *)notification;
234 - (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize;
235 - (void)windowDidResignKey:(NSNotification *)notification;
236 - (void)windowDidBecomeKey:(NSNotification *)notification;
237 - (void)windowDidMove:(NSNotification *)notification;
238 - (BOOL)windowShouldClose:(id)window;
239 - (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame;
243 @implementation wxNonOwnedWindowController
251 - (BOOL)windowShouldClose:(id)nwindow
253 wxNonOwnedWindowCocoaImpl* windowimpl = [(NSWindow*) nwindow WX_implementation];
256 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
263 - (NSSize)windowWillResize:(NSWindow *)window
264 toSize:(NSSize)proposedFrameSize
266 NSRect frame = [window frame];
267 wxRect wxframe = wxFromNSRect( NULL, frame );
268 wxframe.SetWidth( (int)proposedFrameSize.width );
269 wxframe.SetHeight( (int)proposedFrameSize.height );
271 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
274 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
277 wxpeer->HandleResizing( 0, &wxframe );
278 NSSize newSize = NSMakeSize(wxframe.GetWidth(), wxframe.GetHeight());
283 return proposedFrameSize;
286 - (void)windowDidResize:(NSNotification *)notification
288 NSWindow* window = (NSWindow*) [notification object];
289 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
292 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
294 wxpeer->HandleResized(0);
298 - (void)windowDidMove:(NSNotification *)notification
300 wxNSWindow* window = (wxNSWindow*) [notification object];
301 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
304 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
306 wxpeer->HandleMoved(0);
310 - (void)windowDidBecomeKey:(NSNotification *)notification
312 NSWindow* window = (NSWindow*) [notification object];
313 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
316 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
318 wxpeer->HandleActivated(0, true);
322 - (void)windowDidResignKey:(NSNotification *)notification
324 NSWindow* window = (NSWindow*) [notification object];
325 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
328 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
331 wxpeer->HandleActivated(0, false);
332 // Needed for popup window since the firstResponder
333 // (focus in wx) doesn't change when this
334 // TLW becomes inactive.
335 wxFocusEvent event( wxEVT_KILL_FOCUS, wxpeer->GetId());
336 event.SetEventObject(wxpeer);
337 wxpeer->HandleWindowEvent(event);
342 - (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)anObject
346 if ([anObject isKindOfClass:[wxNSTextField class]])
348 wxNSTextField* tf = (wxNSTextField*) anObject;
349 wxNSTextFieldEditor* editor = [tf fieldEditor];
352 editor = [[wxNSTextFieldEditor alloc] init];
353 [editor setFieldEditor:YES];
354 [tf setFieldEditor:editor];
362 - (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame
364 wxUnusedVar(newFrame);
365 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
368 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
369 wxMaximizeEvent event(wxpeer->GetId());
370 event.SetEventObject(wxpeer);
371 return !wxpeer->HandleWindowEvent(event);
378 IMPLEMENT_DYNAMIC_CLASS( wxNonOwnedWindowCocoaImpl , wxNonOwnedWindowImpl )
380 wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl( wxNonOwnedWindow* nonownedwnd) :
381 wxNonOwnedWindowImpl(nonownedwnd)
384 m_macFullScreenData = NULL;
387 wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl()
390 m_macFullScreenData = NULL;
393 wxNonOwnedWindowCocoaImpl::~wxNonOwnedWindowCocoaImpl()
395 if ( !m_wxPeer->IsNativeWindowWrapper() )
397 [m_macWindow setDelegate:nil];
398 [m_macWindow release];
402 void wxNonOwnedWindowCocoaImpl::WillBeDestroyed()
404 if ( !m_wxPeer->IsNativeWindowWrapper() )
406 [m_macWindow setDelegate:nil];
410 void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), const wxPoint& pos, const wxSize& size,
411 long style, long extraStyle, const wxString& WXUNUSED(name) )
413 static wxNonOwnedWindowController* controller = NULL;
416 controller =[[wxNonOwnedWindowController alloc] init];
419 int windowstyle = NSBorderlessWindowMask;
421 if ( style & wxFRAME_TOOL_WINDOW || ( style & wxPOPUP_WINDOW ) ||
422 GetWXPeer()->GetExtraStyle() & wxTOPLEVEL_EX_DIALOG )
424 m_macWindow = [wxNSPanel alloc];
427 m_macWindow = [wxNSWindow alloc];
429 CGWindowLevel level = kCGNormalWindowLevel;
431 if ( style & wxFRAME_TOOL_WINDOW )
433 windowstyle |= NSUtilityWindowMask;
434 if ( ( style & wxMINIMIZE_BOX ) || ( style & wxMAXIMIZE_BOX ) ||
435 ( style & wxCLOSE_BOX ) || ( style & wxSYSTEM_MENU ) )
437 windowstyle |= NSTitledWindowMask ;
440 else if ( ( style & wxPOPUP_WINDOW ) )
442 level = kCGPopUpMenuWindowLevel;
444 if ( ( style & wxBORDER_NONE ) )
446 wclass = kHelpWindowClass ; // has no border
447 attr |= kWindowNoShadowAttribute;
451 wclass = kPlainWindowClass ; // has a single line border, it will have to do for now
455 else if ( ( style & wxCAPTION ) )
457 windowstyle |= NSTitledWindowMask ;
459 else if ( ( style & wxFRAME_DRAWER ) )
462 wclass = kDrawerWindowClass;
467 // set these even if we have no title, otherwise the controls won't be visible
468 if ( ( style & wxMINIMIZE_BOX ) || ( style & wxMAXIMIZE_BOX ) ||
469 ( style & wxCLOSE_BOX ) || ( style & wxSYSTEM_MENU ) )
471 windowstyle |= NSTitledWindowMask ;
474 else if ( ( style & wxNO_BORDER ) )
476 wclass = kSimpleWindowClass ;
480 wclass = kPlainWindowClass ;
485 if ( windowstyle & NSTitledWindowMask )
487 if ( ( style & wxMINIMIZE_BOX ) )
488 windowstyle |= NSMiniaturizableWindowMask ;
490 if ( ( style & wxMAXIMIZE_BOX ) )
491 windowstyle |= NSResizableWindowMask ; // TODO showing ZOOM ?
493 if ( ( style & wxRESIZE_BORDER ) )
494 windowstyle |= NSResizableWindowMask ;
496 if ( ( style & wxCLOSE_BOX) )
497 windowstyle |= NSClosableWindowMask ;
499 if ( extraStyle & wxFRAME_EX_METAL)
500 windowstyle |= NSTexturedBackgroundWindowMask;
502 if ( ( style & wxFRAME_FLOAT_ON_PARENT ) || ( style & wxFRAME_TOOL_WINDOW ) )
503 level = kCGFloatingWindowLevel;
505 if ( ( style & wxSTAY_ON_TOP ) )
506 level = kCGUtilityWindowLevel;
508 NSRect r = wxToNSRect( NULL, wxRect( pos, size) );
510 r = [NSWindow contentRectForFrameRect:r styleMask:windowstyle];
512 [m_macWindow initWithContentRect:r
513 styleMask:windowstyle
514 backing:NSBackingStoreBuffered
518 [m_macWindow setLevel:level];
520 [m_macWindow setDelegate:controller];
522 [m_macWindow setAcceptsMouseMovedEvents: YES];
524 if ( ( style & wxFRAME_SHAPED) )
526 [m_macWindow setOpaque:NO];
527 [m_macWindow setAlphaValue:1.0];
531 void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), WXWindow nativeWindow )
533 m_macWindow = nativeWindow;
536 WXWindow wxNonOwnedWindowCocoaImpl::GetWXWindow() const
541 void wxNonOwnedWindowCocoaImpl::Raise()
543 [m_macWindow orderWindow:NSWindowAbove relativeTo:0];
546 void wxNonOwnedWindowCocoaImpl::Lower()
548 [m_macWindow orderWindow:NSWindowBelow relativeTo:0];
551 void wxNonOwnedWindowCocoaImpl::ShowWithoutActivating()
553 [m_macWindow orderFront:nil];
554 [[m_macWindow contentView] setNeedsDisplay: YES];
557 bool wxNonOwnedWindowCocoaImpl::Show(bool show)
561 wxNonOwnedWindow* wxpeer = GetWXPeer();
562 if (wxpeer && !(wxpeer->GetWindowStyle() & wxFRAME_TOOL_WINDOW))
563 [m_macWindow makeKeyAndOrderFront:nil];
565 [m_macWindow orderFront:nil];
566 [[m_macWindow contentView] setNeedsDisplay: YES];
569 [m_macWindow orderOut:nil];
573 bool wxNonOwnedWindowCocoaImpl::ShowWithEffect(bool show,
577 return wxWidgetCocoaImpl::
578 ShowViewOrWindowWithEffect(m_wxPeer, show, effect, timeout);
581 void wxNonOwnedWindowCocoaImpl::Update()
583 [m_macWindow displayIfNeeded];
586 bool wxNonOwnedWindowCocoaImpl::SetTransparent(wxByte alpha)
588 [m_macWindow setAlphaValue:(CGFloat) alpha/255.0];
592 bool wxNonOwnedWindowCocoaImpl::SetBackgroundColour(const wxColour& WXUNUSED(col) )
597 void wxNonOwnedWindowCocoaImpl::SetExtraStyle( long exStyle )
601 bool metal = exStyle & wxFRAME_EX_METAL ;
602 int windowStyle = [ m_macWindow styleMask];
603 if ( metal && !(windowStyle & NSTexturedBackgroundWindowMask) )
605 wxFAIL_MSG( wxT("Metal Style cannot be changed after creation") );
607 else if ( !metal && (windowStyle & NSTexturedBackgroundWindowMask ) )
609 wxFAIL_MSG( wxT("Metal Style cannot be changed after creation") );
614 void wxNonOwnedWindowCocoaImpl::SetWindowStyleFlag( long style )
618 CGWindowLevel level = kCGNormalWindowLevel;
620 if (style & wxSTAY_ON_TOP)
621 level = kCGUtilityWindowLevel;
622 else if (( style & wxFRAME_FLOAT_ON_PARENT ) || ( style & wxFRAME_TOOL_WINDOW ))
623 level = kCGFloatingWindowLevel;
625 [m_macWindow setLevel: level];
629 bool wxNonOwnedWindowCocoaImpl::SetBackgroundStyle(wxBackgroundStyle style)
631 if ( style == wxBG_STYLE_TRANSPARENT )
633 [m_macWindow setOpaque:NO];
634 [m_macWindow setBackgroundColor:[NSColor clearColor]];
640 bool wxNonOwnedWindowCocoaImpl::CanSetTransparent()
645 void wxNonOwnedWindowCocoaImpl::MoveWindow(int x, int y, int width, int height)
647 NSRect r = wxToNSRect( NULL, wxRect(x,y,width, height) );
648 // do not trigger refreshes upon invisible and possible partly created objects
649 [m_macWindow setFrame:r display:GetWXPeer()->IsShownOnScreen()];
652 void wxNonOwnedWindowCocoaImpl::GetPosition( int &x, int &y ) const
654 wxRect r = wxFromNSRect( NULL, [m_macWindow frame] );
659 void wxNonOwnedWindowCocoaImpl::GetSize( int &width, int &height ) const
661 NSRect rect = [m_macWindow frame];
662 width = (int)rect.size.width;
663 height = (int)rect.size.height;
666 void wxNonOwnedWindowCocoaImpl::GetContentArea( int& left, int &top, int &width, int &height ) const
668 NSRect outer = NSMakeRect(100,100,100,100);
669 NSRect content = [NSWindow contentRectForFrameRect:outer styleMask:[m_macWindow styleMask] ];
670 NSRect rect = [[m_macWindow contentView] frame];
671 left = (int)rect.origin.x;
672 top = (int)rect.origin.y;
673 width = (int)rect.size.width;
674 height = (int)rect.size.height;
677 bool wxNonOwnedWindowCocoaImpl::SetShape(const wxRegion& WXUNUSED(region))
679 [m_macWindow setOpaque:NO];
680 [m_macWindow setBackgroundColor:[NSColor clearColor]];
685 void wxNonOwnedWindowCocoaImpl::SetTitle( const wxString& title, wxFontEncoding encoding )
687 [m_macWindow setTitle:wxCFStringRef( title , encoding ).AsNSString()];
690 bool wxNonOwnedWindowCocoaImpl::IsMaximized() const
692 if (([m_macWindow styleMask] & NSResizableWindowMask) != 0)
694 return [m_macWindow isZoomed];
698 NSRect rectScreen = [[NSScreen mainScreen] visibleFrame];
699 NSRect rectWindow = [m_macWindow frame];
700 return (rectScreen.origin.x == rectWindow.origin.x &&
701 rectScreen.origin.y == rectWindow.origin.y &&
702 rectScreen.size.width == rectWindow.size.width &&
703 rectScreen.size.height == rectWindow.size.height);
707 bool wxNonOwnedWindowCocoaImpl::IsIconized() const
709 return [m_macWindow isMiniaturized];
712 void wxNonOwnedWindowCocoaImpl::Iconize( bool iconize )
715 [m_macWindow miniaturize:nil];
717 [m_macWindow deminiaturize:nil];
720 void wxNonOwnedWindowCocoaImpl::Maximize(bool WXUNUSED(maximize))
722 [m_macWindow zoom:nil];
726 // http://cocoadevcentral.com/articles/000028.php
731 NSRect m_formerFrame;
734 bool wxNonOwnedWindowCocoaImpl::IsFullScreen() const
736 return m_macFullScreenData != NULL ;
739 bool wxNonOwnedWindowCocoaImpl::ShowFullScreen(bool show, long WXUNUSED(style))
743 FullScreenData *data = (FullScreenData *)m_macFullScreenData ;
745 data = new FullScreenData();
747 m_macFullScreenData = data ;
748 data->m_formerLevel = [m_macWindow level];
749 data->m_formerFrame = [m_macWindow frame];
750 CGDisplayCapture( kCGDirectMainDisplay );
751 [m_macWindow setLevel:CGShieldingWindowLevel()];
752 [m_macWindow setFrame:[[NSScreen mainScreen] frame] display:YES];
754 else if ( m_macFullScreenData != NULL )
756 FullScreenData *data = (FullScreenData *) m_macFullScreenData ;
757 CGDisplayRelease( kCGDirectMainDisplay );
758 [m_macWindow setLevel:data->m_formerLevel];
759 [m_macWindow setFrame:data->m_formerFrame display:YES];
761 m_macFullScreenData = NULL ;
767 void wxNonOwnedWindowCocoaImpl::RequestUserAttention(int flagsWX)
769 NSRequestUserAttentionType flagsOSX;
772 case wxUSER_ATTENTION_INFO:
773 flagsOSX = NSInformationalRequest;
776 case wxUSER_ATTENTION_ERROR:
777 flagsOSX = NSCriticalRequest;
781 wxFAIL_MSG( "invalid RequestUserAttention() flags" );
785 [NSApp requestUserAttention:flagsOSX];
788 void wxNonOwnedWindowCocoaImpl::ScreenToWindow( int *x, int *y )
790 wxPoint p((x ? *x : 0), (y ? *y : 0) );
791 NSPoint nspt = wxToNSPoint( NULL, p );
792 nspt = [m_macWindow convertScreenToBase:nspt];
793 nspt = [[m_macWindow contentView] convertPoint:nspt fromView:nil];
794 p = wxFromNSPoint([m_macWindow contentView], nspt);
801 void wxNonOwnedWindowCocoaImpl::WindowToScreen( int *x, int *y )
803 wxPoint p((x ? *x : 0), (y ? *y : 0) );
804 NSPoint nspt = wxToNSPoint( [m_macWindow contentView], p );
805 nspt = [[m_macWindow contentView] convertPoint:nspt toView:nil];
806 nspt = [m_macWindow convertBaseToScreen:nspt];
807 p = wxFromNSPoint( NULL, nspt);
814 bool wxNonOwnedWindowCocoaImpl::IsActive()
816 return [m_macWindow isKeyWindow];
819 void wxNonOwnedWindowCocoaImpl::SetModified(bool modified)
821 [m_macWindow setDocumentEdited:modified];
824 bool wxNonOwnedWindowCocoaImpl::IsModified() const
826 return [m_macWindow isDocumentEdited];
829 wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, WXWindow nativeWindow)
831 wxNonOwnedWindowCocoaImpl* now = new wxNonOwnedWindowCocoaImpl( wxpeer );
832 now->Create( parent, nativeWindow );
836 wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
837 long style, long extraStyle, const wxString& name )
839 wxNonOwnedWindowImpl* now = new wxNonOwnedWindowCocoaImpl( wxpeer );
840 now->Create( parent, pos, size, style , extraStyle, name );