Re: re Hiding controls and another question
Re: re Hiding controls and another question
- Subject: Re: re Hiding controls and another question
- From: Graeme Hiebert <email@hidden>
- Date: Thu, 28 Feb 2002 23:47:07 -0800
On Thursday, February 28, 2002, at 11:14 PM, John Pattenden wrote:
The argument that we should not be able hide controls show a distinct
lack of imagination. In my case I generate UI based on some settings
such as if there is sound. If not then I hide things like a mute
button. Disabling it only confuses users. The argument that we should
not be able to hide controls because it always bad is specious to say
the least...
It sounds to me like you want to set up your interface one way before
you display it, hiding the parts that aren't of interest to you, and
leave it that way until it disappears. This is different from the
scenario which (I think) Erik was talking about. Most people who ask
about this seem to want to hide/show controls while they are displayed;
this is quite jarring to the user, and should definitely be discouraged
in the API.
Cocoa provides other means to dynamically choose what parts of a view
look like. It sounds like these may be more appropriate to your
application than hiding individual controls. (For example, you could
define your control panel for the sound-related controls as a view in a
nib, and load it when you need to display them.)
The other argument that it is very sophisticated and object oriented
also seems pretty bizarre to me "the you're not sophisticated enough"
argument is pretty amusing.. How about I pass my control object a
message to hide itself.. how object oriented would that be??? I think
there may be a tad of Cocoa defence going on here..
I don't know about sophistication, but to individually hide controls
rather than treating them in related groups is not particularly
object-oriented. Objects are what we *make* from the screws and wood
and metal. Sure, the screws and wood and metal are objects too, just as
are the bit patterns that represent our controls within our application.
I'm enjoying Cocoa and perhaps the fact that it simplifies so many
things makes all the more surprising when seemingly simple
functionality is not available...
The functionality certainly is available. There have been several
suggestions over the past few days regarding how to implement it. It
takes about two extra lines of code, and could probably be fairly easily
done with a category on NSControl and a global NSMutableDictionary
instance.
-g
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.