• 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
progress bar question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

progress bar question


  • Subject: progress bar question
  • From: "Ryan Bartig" <email@hidden>
  • Date: Sat, 16 Nov 2002 15:27:56 -0500

I created a small simple project with a button and a progress bar. I subclassed NSObject then added an action and a outlet. I then instantiated the new class and control dragged from the object to the progress bar to connect to create the connect for the outlet. Then I control dragged from the button to the object to connect it to the action. After that I created the two files (.h & .m) in the project. When I click the button nothing happens and am totally lost. Attached below is the code, any help would be greatly appreciated. Thanks in advance.

/* progress_bar (.h file) */

#import <Cocoa/Cocoa.h>

@interface progress_bar : NSObject
{
IBOutlet id progressView;
NSTimer *timer;
}
- (IBAction)pushedButton:(id)sender;
@end

// beginning of .m file
#import "progress_bar.h"

@implementation progress_bar

- (void)awakeFromNib
{
srandom(time(NULL));
}

- (IBAction)pushedButton:(id)sender
{
if([sender state] == 1)
{
NSLog(@"Starting");

timer = [[NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(checkTime:) userInfo:nil repeats:YES] retain];

} else {
NSLog(@"Stopping");

[timer invalidate];
[timer release];
}
}

- (void) checkTime: (NSTimer *) aTimer
{
NSLog(@"check");
[progressView incrementBy:10];
}

@end

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
_______________________________________________
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.
  • Prev by Date: Re: Personal picture in OS X Mail program
  • Next by Date: Re: Button cell palette
  • Previous by thread: full keyboard control simulation?
  • Next by thread: Opening multiple times the same window ?
  • Index(es):
    • Date
    • Thread