Re: NSButtonCell in NSTableView: How can I define button action?
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.