Re: Editable Cell in TableView
Re: Editable Cell in TableView
- Subject: Re: Editable Cell in TableView
- From: Rams <email@hidden>
- Date: Fri, 24 Jan 2003 22:03:27 -0500
If you are looking to have an image to the left of some text in a cell,
there's already a pretty decent one in
/Developer/Examples/AppKit/DragNDropOutlineView. No work necessary
unless you want to add some image scaling =) If that isn't what you
are looking to do, it does give you a good idea of what to do in
selectWithFrame, editWithFrame, etc...
On Thursday, January 23, 2003, at 09:15 PM, Julien Guimont wrote:
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.
--
There are only 10 kinds of people in this world... those who understand
binary and those who don't
_______________________________________________
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.