Re: Hiding an NSControl
Re: Hiding an NSControl
- Subject: Re: Hiding an NSControl
- From: John Stiles <email@hidden>
- Date: Wed, 3 Sep 2003 17:46:38 -0700
On Wednesday, September 3, 2003, at 04:54 PM, Henry McGilton wrote:
FWIW, this won't affect end-user experience. All the control showing
and hiding will happen before the NSWindow ever appears. It's a block
of checkboxes, and sometimes we need four of them, and sometimes we
need fewer.
I concur with Alastair's post on this subject. In general, you should
give very careful consideration to hiding controls, and instead think
of
enabling and disabling them as required. Use analogies with your real
everyday world --- you would expect that the furniture in your living
room stays in the same positions whether the lights are on or off, or
whether the
time is morning or afternoon, and so on.
Trust me, this is the right thing to do. Imagine a dialog like this:
What would you like to do this morning?
[x] Make breakfast
[ ] Have coffee
[x] Read newspaper
(OK) (Cancel)
That could also do this:
What would you like to do this afternoon?
[x] Visit Starbucks
[ ] Have lunch
(OK) (Cancel)
But it's all implemented with the same nib. I am implementing a window
that can display a message, an arbitrary number of checkboxes (up to a
hard limit, in my case 4), and two buttons. How many checkboxes we
actually need depends on the situation--it depends on stuff I'm reading
from a data file. It won't be confusing at all.
The implementation is just a nib with four checkboxes, and I'm "hiding"
and "showing" the ones I don't need and then shrinking the window to
compensate for the missing items. It actually works pretty well right
now; I just had a hard time believing that there's no better way to
hide controls. I can live with things the way they are now--I'm told
tabbing between controls might be wonky, though. :|
_______________________________________________
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.