Pasting complex text into NSSearchField
Pasting complex text into NSSearchField
- Subject: Pasting complex text into NSSearchField
- From: Dan Stein <email@hidden>
- Date: Tue, 18 Jan 2005 08:14:32 -0800
I have some pasteboard methods that extract data from an NSTable and
format it
basically as tab-delimited text, for cut-and-paste operations on table
rows.
My app also has an NSSearchField that is placed programmatically into a
toolbar in the table's window.
The cutting and pasting to and from tables is working fine, but if I
inadvertently paste this
pasteboard type into the search field, it wraps at the record
separators (I am using the \r character to
separate records corresponding to table rows.)
This makes a very ugly mess of the search field's screen area until you
delete the SF contents and
click the inspector cell of the SF again. Yet when I paste the same
contents into search fields as implemented
in Xcode or Safari, there is no wrapping and forcing a full redraw of
the SF is not necessary.
I suspect that the default wrapping behavior of NSSearchField is not
what I want, but how do I get
the desired behavior. I tried sending a setWraps: NO message to the
cell ivar of the search field but
that did not do what I want. Do I need to subclass the search field and
give it a cell that always returns NO
for wrapping?
I could do this with the NSSearchFieldCell that the search field is
wrapped around (no pun intended),
knew I only but how.
Dan
_______________________________________________
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