NSTextFieldCell Shadow and Single Line Editing
NSTextFieldCell Shadow and Single Line Editing
- Subject: NSTextFieldCell Shadow and Single Line Editing
- From: Sean Willson <email@hidden>
- Date: Mon, 26 Dec 2005 00:06:08 -0600
I have been creating a control structure for an application that has an icon
and some text next to it. I'm using the NSTableView and have it working
pretty well, centing the text in the field when drawing but I am having a
few problems getting the last two things working and I was wondering if I
could elicit some help?
First I can't seem to get the text to shadow properly without losing some of
the underlying functionality of the cell. In order for me to get a shadow to
appear I end up having to override the drawInteriorWithFrame: method but if
I actually draw the text it doesn't matter if I choose stringValue or
attributedStringValue method, neither of them handle the line break of
truncating middle or any truncating for that matter. It is always the whole
text value. Does anyone know how to get the truncated value or add a shadow
to just that before display? I looked into the NSFormatter but you don't
have a handle to the state of the cell to tell if it's selected and then
display a different shadow based on that. I suppose I can really hack this
to somehow get a handle to the selected item but that seems really really
bad. Any other ideas?
The other thing I wanted to do was change the editing area of a
NSTextFieldCell to now be the entire cell but only a single line of text. My
cells are taller than normal as I wanted bigger icons but I only want to
show a single row of text to edit. I can't seem to override the right method
to set that area of the cell to not fill the entire space. Any pointers on
where to look for this?
Thanks all ... I appreciate it. Merry Xmas!!!!
Sean
_______________________________________________
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