• 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 (Switch)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSButton (Switch)


  • Subject: Re: NSButton (Switch)
  • From: Todd Heberlein <email@hidden>
  • Date: Thu, 16 Aug 2001 11:39:14 -0700

On 8/16/01 11:35 PM, "stuartbryson" <email@hidden> wrote:
> NSButton but neither work, they all return 0 regardless of what I
> beleive is its state.

"state" should be the right method. I did a quick test and was able to
duplicate your problem: this happened when I disconnected the outlet to the
switch. You might want to see if you have a similar problem (i.e., is
everything connected right).

Here is the snippet I used to check the value:

NSLog(@"State: %d", [switch_button state]);

In your code you will probably want something like

if ([switch_button state] == NSOnState) {
// button is checked. Do stuff
}
else {
// button is not checked. Do something else
}

Todd


References: 
 >NSButton (Switch) (From: stuartbryson <email@hidden>)

  • Prev by Date: Re: Building and installing JDOM
  • Next by Date: Re: Online C++ resources?
  • Previous by thread: Re: NSButton (Switch)
  • Next by thread: Handing off varargs? (Language lawyers, please read.)
  • Index(es):
    • Date
    • Thread