Editable Cell in TableView
Editable Cell in TableView
- Subject: Editable Cell in TableView
- From: Julien Guimont <email@hidden>
- Date: Thu, 23 Jan 2003 21:15:50 -0500
Hi,
I'm playing (and seriously think the computer is cheating with me) with
a table view containing a cell of my own. The cell i made is a in fact
to display a at first a picture using an NSImageCell and a text field
using NSTextFieldCell. It all displays fine.
The only thing I can't get to work is the editing of this last
NSTextFieldCell. In my cell I overrided those functions:
- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView
editor:(NSText *)textObj delegate:(id)anObject start:(int)selStart
length:(int)selLength{
[textField selectWithFrame:textRect inView:controlView
editor:textObj delegate:anObject start:selStart length:selLength];
}
- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView
editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent
*)theEvent{
//est-ce dans le rect de mon field
NSPoint point = [controlView convertPoint:[theEvent
locationInWindow] fromView:NULL];
if(NSPointInRect(point,textRect)){
[textField editWithFrame:textRect inView:controlView
editor:textObj delegate:anObject event:theEvent];
}
}
- (void)endEditing:(NSText *)textObj{
[textField endEditing:textObj];
[super endEditing:textObj];
}
textField is my text field cell and textRect is the rect of this cell.
When the user click on the cell, it activates but the string changes to
the one of the next row (!!!) Yeah this is weird I know. It's me;) I
checked for what's in my textfield and the data from this particular
cell and everything was fine. When the editing stops and I did not
changed the text, it return to the old name. But the editing itself
works fine, I can type in it and all.
Is there anything I have to override or set up to enable this kind of
editing and to make it work properly.
I have other problems, resuming into crashes, but i think they are all
related to this one. I use to say solve each problems one at a time and
at the end you will have solved less than the half you had first.
Thank you guys... and the girl;)
Julien Guimont
Juggy Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.