Search Results

Search found 5 results on 1 pages for 'nsprogressindicator'.

Page 1/1 | 1 

  • NSProgressIndicator woes - perhaps my NSView subclass?

    - by mootymoots
    Hi All I have created a basic application, created a subclassed NSView, and added it as a custom view in interface builder. All works ok. However certain things do not work correctly, which makes me wonder if my NSView is subclassed correctly? Specifically, when using an NSProgressIndicator, I can use startAnimating: and stopAnimating on an indeterminate, but if I try and do anything with a determinate with incrementBy it does nothing. Even if I set the default value of the determinate NSProgressIndicator to 50.0, it appears when the app is launched at 0.0, despite looking good in IB. My NSProgressIndicator is hooked up correctly as an IBOutlet, I can tell it to hide etc, just can't get it to animate at all. However, I also have other issues that make me think that this problem is actually my NSView subclass (such as Quick Look not firing). In my subclass I've simply overridden the initWithFrame: and drawRect methods, calling their [super]. As I said, I've then placed this as a custom view in interface builder and changed it to MyCustomView. All works fine mostly...? Am I subclassing this incorrectly, or not doing something in interface builder correctly? I seem to be missing some small thing?!

    Read the article

  • GUI Agent accepts statuses from Daemon and shows it using progress indicator

    - by Pavel
    Hi to all! My application is a GUI agent, which communicate with daemon through the unix domain socket, wrapped in CFSocket.... So there are main loop and added CFRunLoop source. Daemon sends statuses and agent shows it with a progress indicator. When there are any data on socket, callback function begin to work and at this time I have to immediately show the new window with progress indicator and increase counter. //this function initiate the runloop for listening socket - (int) AcceptDaemonConnection:(ConnectionRef)conn { int err = 0; conn->fSockCF = CFSocketCreateWithNative(NULL, (CFSocketNativeHandle) conn->fSockFD, kCFSocketAcceptCallBack, ConnectionGotData, NULL); if (conn->fSockCF == NULL) err = EINVAL; if (err == 0) { conn->fRunLoopSource = CFSocketCreateRunLoopSource(NULL, conn->fSockCF, 0); if (conn->fRunLoopSource == NULL) err = EINVAL; else CFRunLoopAddSource(CFRunLoopGetCurrent(), conn->fRunLoopSource, kCFRunLoopDefaultMode); CFRelease(conn->fRunLoopSource); } return err; } // callback function void ConnectionGotData(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void * data, void * info) { #pragma unused(s) #pragma unused(address) #pragma unused(info) assert(type == kCFSocketAcceptCallBack); assert( (int *) data != NULL ); assert( (*(int *) data) != -1 ); TStatusUpdate status; int nativeSocket = *(int *) data; status = [agg AcceptPacket:nativeSocket]; // [stWindow InitNewWindow] inside [agg SendUpdateStatus:status.percent]; } AcceptPacket function receives packet from the socket and trying to show new window with progress indicator. Corresponding function is called, but nothing happens... I think, that I have to make work the main application loop with interrupting CFSocket loop... Or send a notification? No idea....

    Read the article

  • Download file with progress bar in cocoa?

    - by happyCoding25
    Hello, I need to have a progress bar that responds to the percent complete of a download in cocoa. I think this might use things like NSProgressindicator and possibly NSTask. I'm not sure if theres an "official" method to download file in cocoa because up until now I just used curl with NSTask. Thanks for any replies.

    Read the article

  • How do I use an indeterminate status indicator as the image for an NSStatusItem?

    - by abrahamvegh
    I have an application that is an NSStatusItem. It has a few different modes, each of which require an external process to be launched, during which the icon is simply highlighted, and appears to be frozen. I want to use the -setImage method (or reasonable facsimile) to display something along the lines of a "spinner" commonly seen in web applications and all over OS X. Is there any native method for accomplishing this (e.g. some instance of NSProgressIndicator?) or must I manually display an animation by cycling through a set of images? In either case, how would I implement?

    Read the article

  • How do I update a progress bar in Cocoa during a long running loop?

    - by Nic
    Hi, I've got a while loop, that runs for many seconds and that's why I want to update a progress bar (NSProgressIndicator) during that process, but it updates only once after the loop has finished. The same happens if I want to update a label text, by the way. I believe, my loop prevents other things of that application to happen. There must be another technique. Does this have to do with threads or something? Am I on the right track? Can someone please give me a simple example, how to “optimize” my application? My application is a Cocoa Application (Xcode 3.2.1) with these two methods in my Example_AppDelegate.m: // This method runs when a start button is clicked. - (IBAction)startIt:(id)sender { [progressbar setDoubleValue:0.0]; [progressbar startAnimation:sender]; running = YES; // this is a instance variable int i = 0; while (running) { if (i++ = processAmount) { // processAmount is something like 1000000 running = NO; continue; } // Update progress bar double progr = (double)i / (double)processAmount; NSLog(@"progr: %f", progr); // Logs values between 0.0 and 1.0 [progressbar setDoubleValue:progr]; [progressbar needsDisplay]; // Do I need this? // Do some more hard work here... } } // This method runs when a stop button is clicked, but as long // as -startIt is busy, a click on the stop button does nothing. - (IBAction)stopIt:(id)sender { NSLog(@"Stop it!"); running = NO; [progressbar stopAnimation:sender]; } I'm really new to Objective-C, Cocoa and applications with a UI. Thank you very much for any helpful answer.

    Read the article

1