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: Michael Becker <email@hidden>
- Date: Fri, 31 Oct 2003 20:53:15 +0100
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
}
Thanks! That was very helpful. Just one other little question and my
problem is solved: I would like to use the row of the clicked button in
my action method. How do I (syntactically) pass this argument to the
action method?
This is my code (snippets):
// right now the variable rowIndex contains the row
[ myButtonCell setAction:(SEL)@selector(deleteObject:)];
. . .
- (void)deleteObject:(id)sender
{
// Here I would like to have the row-index
}
Sorry for asking these questions, but a quick answer will solve all my
problems (I hope) :-)
Thank you!
Bye,
Michael
_______________________________________________
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.