Resetting an NSSearchField
Resetting an NSSearchField
- Subject: Resetting an NSSearchField
- From: "Dan S. Camper" <email@hidden>
- Date: Tue, 07 Jun 2005 10:46:09 -0500
All:
I'm attempting to implement a feature where a user can "reveal" an item that
has been found in an NSOutlineView by entering text in an NSSearchField.
The "reveal" method basically restores the view's full contents, expands
parent items, selects and scrolls to the thing they want to reveal.
Expanding, selecting, et. al. all works fine.
My problem is the NSSearchField. I'd like to clear the user's entry when I
restore the list to visually indicate that the list is now unfiltered. At
present, I've been unable to figure out how to reset that darn field. A
simple setStringValue:@"" call doesn't work, nor does some of the more
esoteric method calls I've tried further up the NSSearchField inheritence
path.
I thought to performClick: on the cancel button, but while NSSearchField
redirects calls to NSSearchFieldCell, there isn't an exposed API for getting
that NSSearchFieldCell from an NSSearchField instance. I can't get the
cancel button except through NSSearchFieldCell.
Is there a way to programmatically reset the NSSearchField text? I feel
like there should be and I'm just missing the blindingly obvious.
Thanks,
DSC
_________________________________________________________________________
Dan S. Camper Borrowed Time, Inc.
Software Thaumaturge http://www.bti.net
_______________________________________________
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