+ m_ok = true ;
+
+#if wxMAC_USE_CORE_GRAPHICS
+ m_window->GetSize( &m_width , &m_height);
+ CGContextRef cg = (CGContextRef) window->MacGetCGContextRef();
+ m_release = false;
+ if ( cg == NULL )
+ {
+ SetGraphicsContext( wxGraphicsContext::Create( window ) ) ;
+ SetDeviceOrigin( x, y );
+ }
+ else
+ {
+ CGContextSaveGState( cg );
+ m_release = true ;
+ // make sure the context is having its origin at the wx-window coordinates of the
+ // view (read at the top of window.cpp about the differences)
+ if ( window->MacGetLeftBorderSize() != 0 || window->MacGetTopBorderSize() != 0 )
+ CGContextTranslateCTM( cg , -window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize() );
+
+ SetGraphicsContext( wxGraphicsContext::CreateFromNative( cg ) );
+ }
+ m_graphicContext->SetPen( m_pen ) ;
+ m_graphicContext->SetBrush( m_brush ) ;
+ SetClippingRegion( 0 , 0 , m_width , m_height ) ;
+#else