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

NSProgressIndicator


  • Subject: NSProgressIndicator
  • From: "John Love" <email@hidden>
  • Date: Fri, 23 May 2008 07:30:39 -0400

I have successfully been able to create a small project whose GUI consists
of a NSProgressIndicator, or wheel, and a Button, titled "Spin". In the .nib
window, the "Controller" is ctrl-dragged to the wheel, specifying an outlet
"wheel" and the Button is ctrl-dragged to the Controller, specifying an
action :spin:".

Within the Controller.h file, I have:

@interface Controller:NSObject {
    IBOutlet NSProgressIndicator *spinner;
    BOOL start;
}

- (IBAction) spin:(id)sender;


Within the Controller.m file, I have:

@implementation Controller

- (id) init {
    if (self = [super init]) {
        spinner = [[[NSProgressIndicator alloc] init] autorelease];
        start = TRUE;
    }

    return self;
}


- (void) awakeFromNib {
 // [theIndicator setStyle:NSProgressIndicatorSpinningStyle];   // already
there
    [spinner setUsesThreadedAnimation:YES];
}


- (IBAction) spin:(id)sender {
    if (start)  [spinner startAnimation:nil];
    else        [spinner stopAnimation:nil];

    start = !start;
}

@end

==========

Works like a champ .. pressing the Button starts, stops the spinning like it
should.

NOW .. another "speed bump" .. how to control the spinning from other
objects, i.e., no IBAction .. so, remove the Button.

Changing the spin method to look like:

- (void) spinIt:(BOOL)begin {
    if (begin)  [spinner startAnimation:nil];
    else        [spinner stopAnimation:nil];
}

Here is what I've tried, to no success:
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Appkido support for Iphone dev
  • Next by Date: NSProgressIndicator -- delete the first message with same title
  • Previous by thread: Re: Appkido support for Iphone dev
  • Next by thread: NSProgressIndicator -- delete the first message with same title
  • Index(es):
    • Date
    • Thread