Re: Focus ring not displaying while editing custom split NSCell
Re: Focus ring not displaying while editing custom split NSCell
- Subject: Re: Focus ring not displaying while editing custom split NSCell
- From: Nygard Steve <email@hidden>
- Date: Mon, 14 May 2007 16:53:19 -0600
On May 14, 2007, at 12:59 PM, Brad Willoughby wrote:
You can see from the picture that when you edit one of the two
sub-cells, the newly-typed text appears over the placeholder text and
there is no focus ring. Any tips are appreciated.
If you make your cell a subclass of NSTextFieldCell, and call [super
drawWithFrame:inView] from your implementation of that method, you'll
get a focus ring when you edit. But then it looks like NSTableView
calls -selectWithFrame:inView:editor:delegate:start:length: on the
cell instead of the editWithFrame:... method, which means you don't
get the event and can't adjust the field editor frame based on the
part you clicked on.
If you can, I would just use two separate table columns, which avoids
these problems and others (like being able to tab between the parts
of your custom cell, controlling the width of each part, etc.).
On the other hand, if you need the values displayed next to each
other, but only need one of the text values to be editable, you
should be able to do this the same way you can get a checkbox
displayed to the left of a text field. It's been a long time since
I've done that, but I think there is example code around.
--
Steve
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden