• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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>)

  • Prev by Date: Outlet to NSBrowser, and cell color
  • Next by Date: Re: Saving to application support folder.
  • Previous by thread: Re: NSButton
  • Next by thread: Re: NSButton
  • Index(es):
    • Date
    • Thread