Re: NSTextView: Can't it be disabled?
Re: NSTextView: Can't it be disabled?
- Subject: Re: NSTextView: Can't it be disabled?
- From: Frédéric BLANC <email@hidden>
- Date: Tue, 31 May 2005 19:13:29 +0200
> Hi, Frederic.
Hi Hiro. And thanks for your quick answer.
> You can disable the NSTextView or NSTextField object but it doesn't
> mean gray-drawing text.
Hmm... Contrary to my NSTextView objects, my NSTextField instances
*do* "understand" the setEnabled(false) message (since inherited from
NSControl). The result is that both the contained text, and the
"enclosure" are visually altered (greyed) to inform the user that the
control is disabled. However, my NSTextView instances can only alter
the inner text :( !
> On these object, 'Disable' means 'not editable' and 'not selectable' so
> on.
If you're right for NSTextView, this is *not* the case for NSTextField
(where disabling means not selectable, not editable AND enclosure
visibly disabled and text greyed too!)
> I think this spec is reasonable because the
> strings on alert panel should be displayed in black and disable.
Sorry, but I didn't get your idea. I'm not sure that standard alert
panels use NSTextViews, but static text fields (i.e., NSTextFields)
instead.
> If you want to display them in gray color just like other control
> things, you can use setTextColor: with setEnabled:.
Sorry not to have detailed this too: currently, I've set my
NSTextViews to be unselectable (which leads to uneditability) AND to
contain greyed text when being displayed as "disabled". The sole
visual aspect that doesn't match NSTextFields' behaviour is the black
enclosing container. (Actually, I thought that a unique+simpler
setEnabled(false) call that would embed all those aspects would be
smarter...)
> Good luck.
Thanks. But if noone can lead me to some official methods, I'm stuck
with 3 choices: accepting that the enclosure of NSTextViews just can't
be visually disabled; requesting an enhancement through Apple's Bug
Reporter interface; or... coding a custom widget to match this
behaviour. (And I sure won't go onto this latter choice ;) !)
Bye,
--
— Frederic BLANC (email@hidden)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden