Re: NSSegmentedControl and Bindings
Re: NSSegmentedControl and Bindings
- Subject: Re: NSSegmentedControl and Bindings
- From: Timothy Larkin <email@hidden>
- Date: Wed, 31 Aug 2005 06:35:42 -0400
On Aug 30, 2005, at 6:10 AM, <email@hidden> <kyoso34-
email@hidden> wrote:
I'm trying to bind either of the two segments in my
NSSegmentedControl object to a particular property in
NSArrayController each, namely canSelectNext:, to set
its enabled binding.
As I understand the documentation, the individual segments do not
work as independent controls, and what you want to do cannot be done
in IB alone. The problem must be addressed through the
NSSegmentedControl. I subclassed NSArrayController, assigned the
NSSegmentedControl target to a method of the array controller
subclass, and within that method distinguished separate actions for
the individual cells. Thus the array controller subclass has a method
click:,
-(IBAction)click:(NSSegmentedControl*)sender
{
int cell = [sender selectedSegment];
if (cell == 0) {
[self add:sender];
} else {
[self remove:sender];
}
}
Tim Larkin
Abstract Tools
_______________________________________________
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