Daniel J Farrell schrieb:
> Hello.
> 
> I am drawing a NSCell in a NSView subclass using,
> 
>     NSCell *cell = [[NSCell alloc] initTextCell:@"NSCell"];
>     [cell setStringValue:@"blahh blahh"];
> 
> I now want the user to be able to edit the next by clicking it with the
> mouse. When the editing is finished I then want to extract the new
> value. I have tried using,
>     
>     [cell setEnabled:YES];
>     [cell setSelectable:YES];
>     [cell setEditable:YES];.
> 
> However, this did not appear to do anything. I assume that I need to
> tell the NSCell exactly how to repond to the mouse. How do I do this? I
> have found,
> 
>     -editWithFrame: inView: editor: delegate: event:
> 
> in the GNUstep documentation but I'm unsure on how to start using it.
> 

Why aren't you using a NSTextField here. Most likely this is what you
are looking for. If you want to stick with a bacic NSCell then you will
have to use your own NSControl subclass and change the method mouseDown:
for it. Again you should have a look at NSTextField to see what you need
to do.

Hope this helps,
Fred


_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to