NSProgressIdicator Image Problems
NSProgressIdicator Image Problems
- Subject: NSProgressIdicator Image Problems
- From: Duncan Oliver <email@hidden>
- Date: Mon, 30 Jun 2003 10:04:35 -0500
After getting around the initial problem of having no cell equivalent
for NSProgressIndicator, I was able to write code that dynamically
creates a progress indicator, then grabs the image from in and places
it in a image cell. The problem is that the picture I grab is grayed
out, and I can't figure out why. Grabbing an image for a static
progress indicator via a outlet produces a proper picture, so I can't
figure it out. Here's some code for creating the picture.
- (id)outlineView:(NSOutlineView *)outlineView
objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
{
NSProgressIndicator *progressBar = [[NSProgressIndicator alloc]
init];
NSRect displayRect = [progressBar bounds];
displayRect.origin.x = 0;
displayRect.origin.y = 0;
displayRect.size.width = 32;
displayRect.size.height = 12;
[progressBar setIndeterminate:NSProgressIndicatorBarStyle];
[progressBar setControlSize:NSSmallControlSize];
[progressBar setStyle:NSProgressIndicatorBarStyle];
[progressBar setIndeterminate:NO];
[progressBar setMinValue:0];
[progressBar setMaxValue:100];
[progressBar setFrame:displayRect];
[progressBar setDoubleValue:50];
if ([[tableColumn identifier] isEqualToString:@"Progress"])
return [[NSImage alloc] initWith
Data:[progressBar
dataWithPDFInsideRect:[progressBar bounds]]];
else
return [item objectForKey:[tableColumn identifier]];
[progressBar release];
}
Any idea? Thanks for the help.
Duncan Oliver
email@hidden
_______________________________________________
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.