switching to 10.10+ API

This commit is contained in:
Stefan Csomor
2020-06-29 22:37:01 +02:00
parent 360240a70b
commit f739fd13ca
3 changed files with 4 additions and 4 deletions

View File

@@ -1180,7 +1180,7 @@ outlineView:(NSOutlineView*)outlineView
wxDataViewCustomRenderer * const renderer = obj->customRenderer;
// if this method is called everything is already setup correctly,
CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
CGContextRef context = [[NSGraphicsContext currentContext] CGContext];
CGContextSaveGState( context );
if ( ![controlView isFlipped] )

View File

@@ -112,7 +112,7 @@ void wxOverlayImpl::Init( wxDC* dc, int x , int y , int width , int height )
CreateOverlayWindow(dc);
wxASSERT_MSG(m_overlayWindow != NULL, _("Couldn't create the overlay window"));
m_overlayContext = (CGContextRef) [[m_overlayWindow graphicsContext] graphicsPort];
m_overlayContext = [[m_overlayWindow graphicsContext] CGContext];
wxASSERT_MSG( m_overlayContext != NULL , _("Couldn't init the context on the overlay window") );
[(id)m_overlayContext retain];
}

View File

@@ -1255,7 +1255,7 @@ void wxOSX_drawRect(NSView* self, SEL _cmd, NSRect rect)
if ( win->UseBgCol() )
{
CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
CGContextRef context = [[NSGraphicsContext currentContext] CGContext];
CGContextSaveGState( context );
CGContextSetFillColorWithColor( context, win->GetBackgroundColour().GetCGColor());
@@ -2298,7 +2298,7 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd))
// setting up the drawing context
// note that starting from 10.14 this may be NULL in certain views
CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
CGContextRef context = [[NSGraphicsContext currentContext] CGContext];
wxpeer->MacSetCGContextRef( context );
if ( context != NULL )
{