From f739fd13ca44f0c4d5a86b69031c1f85c6f326d9 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 29 Jun 2020 22:37:01 +0200 Subject: [PATCH] switching to 10.10+ API --- src/osx/cocoa/dataview.mm | 2 +- src/osx/cocoa/overlay.mm | 2 +- src/osx/cocoa/window.mm | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 48622392ce..b093ca6a6d 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -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] ) diff --git a/src/osx/cocoa/overlay.mm b/src/osx/cocoa/overlay.mm index b4c8f0368c..5e7eac8048 100644 --- a/src/osx/cocoa/overlay.mm +++ b/src/osx/cocoa/overlay.mm @@ -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]; } diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 67e80fb79b..640287c90a 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -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 ) {