• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSProgressIdicator Image Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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] initWithData:[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.

  • Follow-Ups:
    • Re: NSProgressIdicator Image Problems
      • From: Thomas Finley <email@hidden>
  • Prev by Date: Re: Calloc for Cocoa?
  • Next by Date: NSImage vs. NSBitmapImageRep color differences?
  • Previous by thread: Re: Writing Files
  • Next by thread: Re: NSProgressIdicator Image Problems
  • Index(es):
    • Date
    • Thread