Re: NSButton
Re: NSButton
- Subject: Re: NSButton
- From: Hasani Hunter <email@hidden>
- Date: Mon, 8 Oct 2007 14:47:50 -0500
I agree with Mike.. to add to what he has already said, I would look
at NSThread documentation and before your thread exits, call the
[ buttonReference setEnabled:YES ]. Providing that you have a
reference to the button in your code somewhere.
On Oct 8, 2007, at 12:13 PM, Mike Abdullah wrote:
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
_______________________________________________
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>) |
| >Re: NSButton (From: Mike Abdullah <email@hidden>) |