On Oct 6, 2011, at 08:33 , Nick wrote:

> Is there a way to change the color of the NSTextField's focus ring to red
> (to highlight that this is an error)?


I think this sounds like a *terrible* idea. Not because it's a terrible idea, 
but because introducing yet another subtle[-ish] sound/flash/color behavior 
whose meaning isn't obvious into the UI is a terrible idea.

Apart from the problem of foisting yet another arbitrary UI convention on the 
user, the use of color alone to indicate status is not a great idea, and the 
use of red to signal an error is culturally specific and so possible 
off-putting in some parts of the world (though the boat may have already sailed 
on that last issue).

I think the 'NSImageNameInvalidDataFreestandingTemplate' solution, associated 
with label text that explains why the icon is there, is an excellent way to 
show the error, without introducing any new UI behaviors.

> I am wondering if there's a way to do this, notifying the user that he can't
> enter any more text into NSTextField edit box?

I think you're making a mistake in assuming it's a good idea to prevent the 
user from entering the excess text. In many scenarios, it's probably better to 
go ahead and let the user enter any amount of text, and complain afterwards. 
You can show an error condition as described above, or (if, say, your window 
doesn't have room for the entire error description), you can put up an alert 
sheet (when enter is pressed) that says what's wrong and what the limits are.

OTOH, if this is something where the user is very aware of the length 
limitation (for example, the 4-digit passcode used to unlock an iPhone), I'd be 
inclined to just reject the excess text and beep (perhaps with a temporary 
error status message if there's room for it in the UI, perhaps changing the 
color of something in the UI, though not necessarily the text field). 

FWIW.


_______________________________________________

Cocoa-dev mailing list ([email protected])

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

This email sent to [email protected]

Reply via email to