• 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: Stupid newbie question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stupid newbie question...


  • Subject: Re: Stupid newbie question...
  • From: Pandaa <email@hidden>
  • Date: Fri, 27 May 2005 02:32:22 +0200


27 maj 2005 kl. 00.02 skrev Brian O'Brien:

Honestly!

I have two radio buttons and I can't figure out how to find out which state the set is in...
The object thats passed to my action is an NSMatrix.
I assume this is a matrix of buttons and I guess I'm supposed to be able to go through each one and figure out
which is the currently selected button..
Help?

You can use -(id)selectedCell to find out which of your radio button cells are selected. From the documentation:
"- (id)selectedCell


Returns the most recently selected cell, or nil if no cell is selected. If more than one cell is selected, this method returns the cell that is lowest and farthest to the right in the receiver."

To distinguish between your two button cells, you can set their tags to unique values in Interface Builder and then query the return value of [matrix selectedCell] with a -(int)tag message. You can then send - (BOOL)selectCellWithTag:(int)aTag to the NSMatrix instance to select one of the cells programatically.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. email@hidden . . www.synapticpulse.net .


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Stupid newbie question... (From: "Brian O'Brien" <email@hidden>)

  • Prev by Date: Re: NSTextView insertText & undo
  • Next by Date: Re: NSSplitView and subviews, awkward?
  • Previous by thread: Re: Stupid newbie question...
  • Next by thread: Many many tabs
  • Index(es):
    • Date
    • Thread