discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSControl question


From: Alexander Malmberg
Subject: Re: NSControl question
Date: Fri, 24 Sep 2004 00:38:05 +0200
User-agent: Mozilla Thunderbird 0.5 (X11/20040306)

Andreas Hoeschler wrote:
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];
    }
}

- Alexander Malmberg




reply via email to

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