NSSegmentedControl Behavior
NSSegmentedControl Behavior
- Subject: NSSegmentedControl Behavior
- From: Jason Barker <email@hidden>
- Date: Mon, 17 Apr 2006 14:00:48 -0600
I have a segmented control in a window and when I click on one of the
segments, I want to get the label for the segment and then change it
back to a non-selected state. Here's what I think my code should be
to accomplish this but it's not working the way I thought it would.
The segment stays selected. What do I need to change to make it
behave the way I want it to?
- (IBAction)controlClicked:(id)sender
{
int currIdx = [segmentedControl selectedSegment];
NSString *segmentLabel = [segmentedControl labelForSegment:currIdx];
NSLog(@"Segment Label: %@", segmentLabel);
[segmentedControl setSelected:NO forSegment:currIdx];
... Additional processing ...
}
Thanks for your help,
Jason
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden