On 5 Apr 2017, at 12:05, J.E. Schotsman <jesc...@xs4all.nl> wrote:
> 
>> On 05 Apr 2017, at 11:48, Jack Carbaugh <intrn...@aol.com> wrote:
>> 
>> Get a list of the controls then loop through it, setting each enabled 
>> property to false. The container holding them will hold a reference to them
> 
> That way you lose the latent enabled state.
> When the embedder is set to disabled some of the sub controls may already be 
> disabled.

As a general principle, the UI shouldn’t be being used to store things; it 
should instead reflect the internal state of your program.  Put another way, 
*your code* should keep track of which controls are supposed to be enabled at 
any point, and you shouldn’t rely on the user interface layer to store that 
information for you.  I know *some* Cocoa controls can be used to store state, 
but IMO that’s a bad design pattern, not least because it means the UI could 
diverge from your program’s internal state; and it won’t work for all controls 
in any case as some of them fetch data from your code on the fly (e.g. 
NSTableView or NSOutlineView).

Whether you use bindings or whether you explicitly update your UI is up to you. 
 Neither is hard.

Kind regards,

Alastair.

--
http://alastairs-place.net

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to