Image missing in Palette?
Image missing in Palette?
- Subject: Image missing in Palette?
- From: Thomas Lachand-Robert <email@hidden>
- Date: Thu, 21 Mar 2002 21:13:10 +0100
Is there a special location to put images for a palette? I have a custom
control whose (simplified) drawRect is as follows:
- (void)drawRect:(NSRect)rect
{
NSRect bounds = [self bounds];
NSImage *image = [[NSImage imageNamed:@"myImage"] retain];
if (!image) {
NSLog(@"Error in TLRTranslation: image missing");
[[NSColor redColor] set];
[NSBezierPath fillRect:bounds];
}
else {
NSSize size = [image size];
[image drawInRect:bounds fromRect:NSMakeRect(0, 0, size.width,
size.height)
operation:NSCompositeSourceOver fraction:1.0];
}
}
This works in the original project (with file "myImage.tiff" in Resources
folder), but now I'm trying to create a palette for this control. The
palette loads, but I get only the red rectangle and the Log message, even
though the file "myImage.tiff" is in the Resources folder of the palette,
too. So maybe I should put it somewhere else?
Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.