• 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
NSSegmentedCell in table column
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSSegmentedCell in table column
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: char Array to NSString to cString?
  • Next by Date: NSTabViewItem Label binding
  • Previous by thread: Re: char Array to NSString to cString?
  • Next by thread: Re: NSSegmentedCell in table column
  • Index(es):
    • Date
    • Thread