• 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: NSButtonCell in NSTableView: How can I define button action?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSButtonCell in NSTableView: How can I define button action?


  • Subject: Re: NSButtonCell in NSTableView: How can I define button action?
  • From: Henry McGilton <email@hidden>
  • Date: Fri, 31 Oct 2003 10:19:40 -0800

On Friday, October 31, 2003, at 09:29 AM, Michael Becker wrote:

Hello!

I have an NSTableView that adds rows when certain data is dragged & dropped onto the NSTableView. Every new row contains an NSButtonCell with a "Delete" button. Everything works fine, so far. However, I don't know how to perform an action when the button is pressed. Because buttons are added dynamically, I cannot connect them via Interface Builder.


In your controller code where you programmatically add the buttons, you would do something like:


[yourNewButtonInstance setTarget: self]; // or whomever is supposed to do the job
[yourNewButtonInstance setAction: (SEL)@selector(jumpThroughHoops:)];
[yourNewButtonInstance setToolTip: @"Cycle Position of Origin"]; // optional

where jumpThroughHoops is your action method. You would define
jumpThroughHoops like this:

- (void) jumpThroughHoops:(id)sender
{
// here is your code to jump through hoops
}

Read 'Implementing the target/action mechanism' methods in the
NSControl document.


Best Wishes,
........ Henry


===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSButtonCell in NSTableView: How can I define button action?
      • From: Michael Becker <email@hidden>
References: 
 >NSButtonCell in NSTableView: How can I define button action? (From: Michael Becker <email@hidden>)

  • Prev by Date: Re: NSButtonCell in NSTableView: How can I define button action?
  • Next by Date: Re: Transparent Windows are Opaque to Classic
  • Previous by thread: Re: NSButtonCell in NSTableView: How can I define button action?
  • Next by thread: Re: NSButtonCell in NSTableView: How can I define button action?
  • Index(es):
    • Date
    • Thread