NSSegmentedCell in table column
NSSegmentedCell in table column
- Subject: NSSegmentedCell in table column
- From: Martin Höller <email@hidden>
- Date: Fri, 1 Jun 2007 17:54:28 +0200
Hi,
I have an NSSoutlineView with several columns. One contains a
NSSegmentedCell with 3 segments as data cell which I set in IB. This
works perfectly well but i have trouble detecting which segment was
pressed.
This is what I'm doing in my action method:
- (IBAction)actionButtonClicked:(id)sender
{
int selectedRow = [olv selectedRow];
id item = [olv itemAtRow:selectedRow];
id cell = [[olv tableColumnWithIdentifier:@"Action_Col"]
dataCellForRow:selectedRow];
int clickedSegment = [cell selectedSegment];
NSLog(@"row: %d, segment: %d", selectedRow, clickedSegment);
....
}
In theory, clickedSegment should always contain the index of the
selected segment in the NSSegmentedCell of selectedRow. Unfortunately
this is only true if the row was selected by the user beforehand.
Otherwise, clickedSegment contains -1. E.g. row 5 is selected and the
user clicks segment 1 in row 10. In this case, clickedSegment is -1
and I can not determine which segment was clicked.
Any ideas how I can change this?
Thanks,
Martin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden