Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » NSImage invalid memory access
NSImage invalid memory access [message #991239] Tue, 18 December 2012 00:11
Edu Garcia is currently offline Edu GarciaFriend
Messages: 9
Registered: September 2011
Junior Member
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 imgActionTemplate = Image.cocoa_new(display, SWT.ICON, nsImage);
toolItem.setImage(imgActionTemplate);

I've also noticed than I can get the image working if I do:
Image img2 = new Image(display, imgActionTemplate.getImageData())

... but in this case, I get a black image, and not an image with template behaviour (automatic graying / highlighting, etc), of course

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

Thanks in advance!
Previous Topic:KTable scroll to focus
Next Topic:SWT Browser On ARM Linux ?
Goto Forum:
  


Current Time: Fri Dec 19 10:20:01 GMT 2014

Powered by FUDForum. Page generated in 0.02965 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software