Re: Disabling items in NSTabView
Re: Disabling items in NSTabView
- Subject: Re: Disabling items in NSTabView
- From: "Daniel T. Staal" <email@hidden>
- Date: Wed, 30 May 2007 11:57:54 -0400 (EDT)
- Importance: Normal
On Tue, May 29, 2007 11:01 pm, Chris Hanson said:
>
> 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.
Thanks, how to do that was what I was looking for and what Erik found for me.
> 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.
Definately nicer than any of the ideas I had for work-arounds.
> 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.
For myself, I see no problem with inserting small amounts of code to
control the model in the controller rather than doing large amounts or
work setting up the model. And experience has taught me that any time I
try to manually do something for _every_ item on some list two things are
true: I will forget at least one item the first time, and: There is
usually an better way by letting the computer do the work.
This was a case where I was sure the latter must be true, but I was having
trouble seeing it. Thanks again to Erik for pointing me to what I had
missed.
Daniel T. Staal
---------------------------------------------------------------
This email copyright the author. Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes. This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------
_______________________________________________
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