Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] NSImage Invalid memory access

Hello.

In Mac OSX (Lion) I'm trying to use named images with NSImage.imageNamed(). Getting the image works, as I can read the details, size, etc.

But when I try to use the image on a toolbar item or TreeItem, I get an "Invalid memory access of location 0x18 rip=0x7fff96bf3350", with different addresses depending on the image.

The thing is, trying with "NSDescendingSortIndicator" or "NSAscendingSortIndicator" works fine! But if I try to use "NSActionTemplate" or "NSAction" for example, I get the mentioned error.

This is the relevant part of my code, although I don't think I'm doing anything fancy:

NSImage nsImage = NSImage.imageNamed(NSString.stringWith("NSActionTemplate"));
Image img = Image.cocoa_new(display, SWT.ICON, nsImage);
toolItem.setImage(img);

Also, I don't know if there is other way of getting named images without OSX specific code.

Thanks in advance!

Back to the top