Re: NSButton
Re: NSButton
- Subject: Re: NSButton
- From: Mike Abdullah <email@hidden>
- Date: Mon, 8 Oct 2007 18:13:21 +0100
I would strongly recommend you learn a little about multithreading. In
your "My function code here" bit, your application is blocking the
main thread so users can't actually click the button anyway. Instead,
you need to disable the button and then perform the work on a separate
thread. Once that has finished you can re-enable the button again.
Mike.
On 8 Oct 2007, at 14:01, santosh wrote:
Hi,
I want to disable the NSButton on click of it and enabled it again
when it finish it work.
I have written a code for this like follow;
(IBAction)setDestination:(id)sender
{
[sender setEnabled:NO];
/*
My function code here
*/
[sender setEnabled:YES];
}
But if i debug this code it's not disabled the button after first
statement so if i click on the button continuously it hangs the
application.
_______________________________________________
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
_______________________________________________
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
References: | |
| >NSButton (From: santosh <email@hidden>) |