discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSControl question


From: Andreas Hoeschler
Subject: Re: NSControl question
Date: Fri, 24 Sep 2004 01:06:30 +0200


Interesting! I observed a different behaviour on MacOSX. However, I get the point. I modified my association so that it checks the current objectValue and only invokes setObjectValue: if the value to be set is different. This works around my problem without removing the abortEditing line in setObjectValue. It's cumbersome. Would it be feasable to bring this functionality to setObjectValue:. I guess Coca only removes the editor, if setObjectValue: actually changes the objectValue, not if the same objectValue is reapplied.

I don't think that would be right. If we're going to abort editing at all, I'm fairly certain that we should do it always. I'm more inclined towards restarting editing after the change. A quick hack for NSTextField:s looks something like:

- (void) setStringValue: (NSString *)aString
{
  NSCell *selected = [self selectedCell];
  BOOL wasEditing = [self abortEditing];

  [selected setStringValue: aString];
  if (![selected isKindOfClass: actionCellClass])
    [self setNeedsDisplay: YES];

  if (wasEditing)
    {
      [self selectText: nil];
    }
}

I could live with that. We should apply a corresponding modification to setObjectValue:

Regards,

 Andreas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]