discuss-gnustep
[Top][All Lists]
Advanced

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

Re: gui fixes


From: Andreas Höschler
Subject: Re: gui fixes
Date: Tue, 4 Sep 2007 15:30:16 +0200

Hi Fred,

I removed the above hack and instead implemented the following in NSCell.

- (NSAttributedString*) attributedStringValue
{
  if (_formatter != nil)
    {
      NSDictionary *attributes;
      NSAttributedString *attrStr;

+      SEL sel = @selector(validateEditing);
+      if ([[self controlView] respondsToSelector:sel]) [[self
controlView] performSelector:sel];

      attributes = [self _nonAutoreleasedTypingAttributes];
attrStr = [_formatter attributedStringForObjectValue: _object_value
                withDefaultAttributes: attributes];
   ...
}

- (id)objectValue
{
+   SEL sel = @selector(validateEditing);
+ if ([[self controlView] respondsToSelector:sel]) [[self controlView]
performSelector:sel];
   if (_cell.has_valid_object_value)
     {
      return _object_value;
     }
   else
     {
      return nil;
     }
}

This solves the problem as well and is probably less hackish. Any
objections?

Regards,

  Andreas


Fixed in a similar way in SVN.

In the meanwhile I figured out that the addition of the two lines above in attributedStringValue: generates a loop. One at least should check whether object value is invalid and perform them only in that case (once).

Regards,

  Andreas





reply via email to

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