• 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: custom view in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: custom view in NSTableView


  • Subject: Re: custom view in NSTableView
  • From: Brian Hill <email@hidden>
  • Date: Mon, 13 Aug 2001 16:10:33 -0500

On Monday, August 13, 2001, at 03:45 PM, Sarat Kongara wrote:

>Responding to user clicks on the button is the same, but in reverse...8-)

I didn't understand what you meant by the above line. I set a target and
action for the button using setAction and setTarget. But how do I make
the button the sender of the message.

If the signature of the action method is (void) toggleSwitch: (id)
sender, the sender that the method is getting is the NSTableView and not
the switch button. Also the same method gets called for each button, I
am trying to use a side effect of the button clicking, the row in the
table gets selected when I click the button and I can use the row number
to find out which button is clicked. What's the better way to handle
this.

I'm not sure you really want to set an action message on the button. When you click the button, the 'tableView:setObjectValue:forTableColumn:row:' message will get sent to the table's data source if it implements this method. You should get either a 1 or 0 as the object value (as an NSNumber) depending on the value of the button (that's what I meant by 'the same but in reverse').

You'd have the row passed into the method at that point.

Brian

email@hidden http://personalpages.tds.net/~brian_hill
___________________________________________________________
"Why? I came into this game for adventure - go anywhere, travel
light, get in, get out, wherever there's trouble, a man alone.
Now they've got the whole country sectioned off and you can't
move without a form. I'm the last of a breed."
-- Archibald "Harry" Tuttle, Rogue HVAC Repairman
___________________________________________________________


References: 
 >Re: custom view in NSTableView (From: Sarat Kongara <email@hidden>)

  • Prev by Date: ObjectAlloc -- not able to use with debugger launched app?
  • Next by Date: saing files in carbon(QT) from cocoa. help!
  • Previous by thread: Re: custom view in NSTableView
  • Next by thread: NSCursor
  • Index(es):
    • Date
    • Thread