Re: troubles with a progress bar updating
Re: troubles with a progress bar updating
- Subject: Re: troubles with a progress bar updating
- From: Shawn Erickson <email@hidden>
- Date: Sun, 11 Dec 2005 12:36:07 -0800
On Dec 11, 2005, at 11:11 AM, Jeff Childers wrote:
I cant seemed to get my progress bar to update. When I create the
object I tried to
set it to 50% but it won't update.
@implementation WindowController
-(void)awakeFromNib{
thisProgress = [[MyProgressIndicator alloc] init];
NSLog(@"loaded");
}
--------------------------------------------------------
@interface MyProgressIndicator : NSObject
{
IBOutlet id progressBar;
int currentProgress;
int incrementer;
}
It looks like you have a window controller instantiated in your nib
and it has an outlet to a progress bar that you dragged and dropped
into a window in your nib, right?
If that is true then this "thisProgress = [[MyProgressIndicator
alloc] init];" is resulting in your outlet pointing at a new instance
of your MyProgressIndicator, one that it not in any view or window
instead of the instance you likely connected it with in your nib. If
you are using a subclass of NSProgressView (which it looks like) then
in IB drag and drop an NSProgressView instance and then set it to you
custom subclass (properties panel option).
Also I see display and displayIfNeeded calls in your code.... bad
habit to have unless really immediate drawing. You should be sending
your views setNeedsDisplay:YES instead otherwise you could be
triggering over drawing. Anyway setting the progress indicators value
should be enough to get it to redisplay itself.
-Shawn
_______________________________________________
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