Re: Disabling items in NSTabView
Re: Disabling items in NSTabView
- Subject: Re: Disabling items in NSTabView
- From: Chris Hanson <email@hidden>
- Date: Tue, 29 May 2007 20:01:43 -0700
On May 29, 2007, at 11:45 AM, Daniel T. Staal wrote:
Conveniently, almost all of the controls to disable are in an
NSTabView.
What I'd really like to do therefore is: [myTabView setEnabled:NO] and
have it disable everything in the tab view. Unfortunately, it
appears no
one has written that method yet. ;) In fact, as far as I can see
there
is no way to get a list of every item on the NSTabView programtically.
There are two other options.
4: Write some code for the controller that manages your tab view that
can walk the view hierarchy for a particular tab and enable/disable
the appropriate controls. For example, it can look for all views that
are subclasses of NSControl, or it can look for all views with a
particular tag value.
5: Bind the "enabled" property of every control that should be
enabled/disabled to a key on the controller that manages your tab
view, or at the model level. Then just change that key and let the
interface changes happen as a side-effect.
Personally, I'd do #5 and put the "this information is locked for
editing" information in the model rather than controller layer. That
keeps the layer boundaries clean and it lets the interface do whatever
is most appropriate.
-- Chris
_______________________________________________
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