Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question



Hi,

On Tuesday, September 2, 2003, at 07:00 PM, Tehrani, Henry wrote:

I am creating a native application under OSX and have some problems that I
did not have under OS9.
1. Why can't I update the display or drawing on a window as I have it
displayed while doing a long calculation?
If you only use [something setNeedsDisplay:YES], the redraw will occur on the next event loop.
You've to call [something displayIfNeeded] to force an immediate redraw.

2. How do I update the progress bar as I do a long calculation?
See above.

3. How do I create a separate thread for doing this kind of long processes
with a cancel button?
There is a NSThread class : Your can send it (the NSThread class) a detachNewThreadSelector:... message to create a
new thread.
You will find many (useful) details in the documentation : Documentation > Cocoa > Resource Management > Multithreading
about communication between the threads (NSConnection), locking the objects (NSLock), redrawing the screen...

--
Bruno Gaufier
----
email@hidden
email@hidden

http://perso.club-internet.fr/bgaufier/
_______________________________________________
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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.