From 502fe6953ebc27dde3622ea9fa8313364c412217 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 20 Aug 2011 10:00:50 +1000 Subject: Replace call available only on 10.6 with sequence that works on 10.5. --- cocoa/PlatCocoa.mm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 75803e33b..e2e2915f5 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -1378,7 +1378,10 @@ static NSImage* ImageFromXPM(XPM* pxpm) img = [NSImage alloc]; [img autorelease]; CGImageRef imageRef = surfaceIXPM->GetImage(); - [img initWithCGImage:imageRef size:NSZeroSize]; + [img initWithSize:NSZeroSize]; + NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef]; + [img addRepresentation: bitmapRep]; + [bitmapRep release]; CGImageRelease(imageRef); delete surfaceXPM; } @@ -1836,7 +1839,10 @@ void ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsig [img autorelease]; CGImageRef imageRef = ImageFromRGBA(width, height, pixelsImage, false); NSSize sz = {width, height}; - [img initWithCGImage:imageRef size:sz]; + [img initWithSize: sz]; + NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef]; + [img addRepresentation: bitmapRep]; + [bitmapRep release]; CGImageRelease(imageRef); [img retain]; ImageMap::iterator it=images.find(type); -- cgit v1.2.3