• 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
NSProgressIndicator/drawRect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSProgressIndicator/drawRect


  • Subject: NSProgressIndicator/drawRect
  • From: Christian Stieber <email@hidden>
  • Date: Tue, 04 Apr 2006 16:12:44 +0200

Hi,

originally, I thought I could add a text display on top of a
NSProgressIndicator, but even when I ensured that the NSText
was added AFTER the progress indicator (addSubview says "above
its siblings", so I removed the NSText and added it again),
the progress indicator (rather, the blue bar) would cover
the text.

So, next attempt. Make a subclass of NSProgressIndicator:

@interface WTG_Framework_Level : NSProgressIndicator
{
  NSString *Value;
}
-(void)setString:(NSString *)String;
@end

@implementation WTG_Framework_Level
...
-(void)setString:(NSString *)String
{
  [Value dealloc];
  Value=[String copy];
  [self setNeedsDisplay:YES];
}
-(void)drawRect:(NSRect)Rectangle
{
  [super drawRect:Rectangle];
  [(id)Value drawInRect:Rectangle withAttributes:nil];
}
@end

Funny enough, even THAT doesn't work??? It does render
something, so I guess the string-drawing works (haven't
done this before), but the blue bar is still overwriting
the text.

So --- what do I have to do? Apparently drawRect isn't
the only thing I need to catch...

Christian

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Adding Frameworks, etc
  • Next by Date: Combo Box, Core Data & Predicate
  • Previous by thread: Re: Adding Frameworks, etc
  • Next by thread: Re: NSProgressIndicator/drawRect
  • Index(es):
    • Date
    • Thread