Re: unresponsive button in panel
Re: unresponsive button in panel
- Subject: Re: unresponsive button in panel
- From: "M. Uli Kusterer" <email@hidden>
- Date: Sun, 20 Jul 2003 21:19:04 +0200
At 18:37 Uhr +0000 20.07.2003, Brad Peterson wrote:
My problem is that the cancel button is entirely unresponsive -- no
matter how often I click it, as long as the app is in the middle of
copying a set of files, I'm stuck waiting.
I suspect this has to do with the fact that I'm doing this all in
the same thread, but I don't have a lot of choice there... I need
everything to happen synchronously (that is, in a specific order
with each piece waiting until the other is done) so that's
intentional.
You have to give the OS an opportunity to process events. Several
options come to mind:
1) Somehow call an NSApplication method that checks for new user
events and processes them. I don't know whether there is such a
method, though.
2) Do the copying in a separate thread (all of it). And check a
global "cancel" variable at regular intervals, and if it is set,
abort and kill the thread. Then, in your main thread, have the
"Cancel" button set this variable to TRUE.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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.