• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSCell editing weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCell editing weirdness


  • Subject: Re: NSCell editing weirdness
  • From: Matt Neuburg <email@hidden>
  • Date: Wed, 04 Oct 2006 10:02:01 -0700
  • Thread-topic: NSCell editing weirdness

On Tue, 3 Oct 2006 23:05:41 +0100, David Aames <email@hidden>
said:
>I've also overridden the selectWithFrame: too but still it isn't
>called. TBH I'm just fed up and I have no ideas what to do...

Lose the attitude and try again. I just did exactly what you said, i.e.:

    NSCell* c = [[OtherCell alloc] initTextCell:@""];
    [c setEditable:YES];
    [[[myTableView tableColumns] objectAtIndex:0] setDataCell:c];

and, in OtherCell:

- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView
editor:(NSText *)textObj delegate:(id)anObject start:(int)selStart
length:(int)selLength {
    NSLog(@"selecting");
    [super selectWithFrame:aRect inView:controlView editor:textObj
delegate:anObject start:selStart length:selLength];
}

and selectWithFrame: *is* called. m.

>On 3 Oct 2006, at 22:09, Philip Dow wrote:
>
>> I've found that the selectWithFrame equivalent is often called when
>> the editWithFrame is what you'd expect. Try overriding that method
>> instead. You can accomplish the same function with it.
>>
>> -Phil
>>
>> On Oct 3, 2006, at 9:22 PM, David Aames wrote:
>>
>>> Hi all,
>>>
>>> I've subclasses NSTextFieldCell to experiment implementing
>>> editWithFrame but the method never gets called! Here's the code
>>> which I'm using to set the cell up:
>>>
>>> NSCell* c = [[DACell alloc] initTextCell:@""];
>>> [c setEditable:YES];
>>> [[[table tableColumns] objectAtIndex:0] setDataCell:c];
>>>
>>> and i've overridden editWithFrame like this
>>>
>>> - (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView
>>> editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent *)
>>> theEvent {
>>>  NSLog(@"editing");
>>>  [super editWithFrame:aRect inView:controlView editor:textObj
>>> delegate:anObject event:theEvent];
>>> }
>>>
>>> but it never gets called. Hmmm what am I doing wrong?
>>>
>>> Regards,
>>> David
>>> _______________________________________________
>>> 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
>>>
>>
>
>
>
>

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



 _______________________________________________
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

  • Prev by Date: Re: Now CGEventCreateKeyboardEvent just doesn't work...
  • Next by Date: accessibility and iTunes?!?
  • Previous by thread: Re: NSCell editing weirdness
  • Next by thread: Bezier Path Arc Problem
  • Index(es):
    • Date
    • Thread