NSProgressIndicator/drawRect
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