Auto-hiding and auto-showing an NSTextField border
Auto-hiding and auto-showing an NSTextField border
- Subject: Auto-hiding and auto-showing an NSTextField border
- From: Nick Zitzmann <email@hidden>
- Date: Tue, 7 Dec 2004 14:38:20 -0700
OK, I've searched the archives and tried a number of things, but I
can't figure this one out...
I have an NSTextField with no border. I want the border to appear when
the text field is the first responder, and disappear when it is no
longer the first responder. How do I get it to do this?
I already tried:
1. Subclassing NSTextField & overriding -becomeFirstResponder to turn
on the border, and -resignFirstResponder to turn it back off (which
doesn't work since the text field immediately hands off first responder
status to the field editor, causing -resignFirstResponder to be called
just after -becomeFirstResponder)
2. Subclassing NSTextField & overriding -drawRect: (it isn't called
when the text field is editing)
3. Setting -controlTextDidBeginEditing: in the text field's delegate
(it is never called, although -controlTextDidEndEditing: is called)
Alternately, is there any way to override the field editor for
NSTextField to make it use a different NSTextView subclass? If so, how
do I do that?
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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