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 16:58:20 +0200

Hi Fred,

I used the following two methods on NSActionCell in my patch. Couls you
please check, whether they also result in a loop?

- (id)objectValue
{
  if (_control_view)
    if ([_control_view isKindOfClass: controlClass])
      [(NSControl *)_control_view validateEditing];
  return [super objectValue];
}

/**
 * Retrieve the value of the receiver as an NSAttributedString.
 */
- (NSAttributedString*)attributedStringValue
{
  if (_control_view)
    if ([_control_view isKindOfClass: controlClass])
      [(NSControl *)_control_view validateEditing];
  return [super attributedStringValue];
}

Even for your code, I don't see how this could result in a loop.

But it does loop! I edeitz a cell (with a formatter) in a tableview and tab to the next cell. While this next cell is in editing mode it loops. The method NSTableView validateEditing is called over and over. When click anywhere into the tableview to abort editing the cell, the loop stops!?

#0  0xfdac1500 in _write () from /lib/libc.so.1
#1  0xfdab2bb0 in write () from /lib/libc.so.1
#2  0xfde3cdc0 in _NSLog_standard_printf_handler (message=0x258d518)
    at NSLog.m:174
#3 0xfde3d618 in NSLogv (format=0x203cde8, args=0xffbfd438) at NSLog.m:357
#4  0xfde3ce84 in NSLog (format=0xff139e88) at NSLog.m:253
#5  0xfef0f7f0 in -[NSTableView validateEditing] (self=0x29e3fa8,
    _cmd=0xff1025e0) at NSTableView.m:3167
#6  0xfecf5c40 in -[NSActionCell attributedStringValue] (self=0x1f61840,
    _cmd=0xff10e72c) at NSActionCell.m:54
#7 0xfed7a87c in -[NSCell drawInteriorWithFrame:inView:] (self=0x1f61840,
    _cmd=0xfcf26868, cellFrame=
{origin = {x = 689, y = 65.5}, size = {width = 49, height = 13}},
    controlView=0x29e3fa8) at NSCell.m:1952
#8 0xfcee7038 in -[NSTextFieldCell(theme) drawInteriorWithFrame:inView:] (
    self=0x1f61840, _cmd=0xfcf26868, cellFrame=
{origin = {x = 689, y = 65.5}, size = {width = 49, height = 13}},
    controlView=0x29e3fa8) at NSTextFieldCell.m:29
#9  0xfcee7340 in -[NSTextFieldCell(theme) drawWithFrame:inView:] (
    self=0x1f61840, _cmd=0xfcf21238, cellFrame=
{origin = {x = 689, y = 65.5}, size = {width = 49, height = 13}},
    controlView=0x29e3fa8) at NSTextFieldCell.m:63
#10 0xfced64c0 in -[NSTableView(theme) drawRow:clipRect:] (self=0x29e3fa8,
---Type <return> to continue, or q <return> to quit---
    _cmd=0xfcf211d8, rowIndex=4, clipRect=
        {origin = {x = 0, y = 0}, size = {width = 912, height = 164}})
    at NSTableView.m:376
#11 0xfced5e48 in -[NSTableView(theme) drawRect:] (self=0x29e3fa8,
    _cmd=0xff13e820, aRect=
        {origin = {x = 0, y = 0}, size = {width = 912, height = 164}})
    at NSTableView.m:293

#12 0xfef4c29c in -[NSView displayRectIgnoringOpacity:inContext:] (
    self=0x29e3fa8, _cmd=0xff13e810, aRect=
        {origin = {x = 0, y = 0}, size = {width = 912, height = 164}},
    context=0x1f20e80) at NSView.m:2374
#13 0xfef4bda4 in -[NSView displayRectIgnoringOpacity:] (self=0x29e3fa8,
    _cmd=0xff13e800, aRect=
{origin = {x = -6.02834367e-21, y = 1.16431587e-10}, size = {width = nan(0x7fca7c), height = -3.04403169e-11}}) at NSView.m:2319
#14 0xfef4b7b0 in -[NSView displayIfNeededInRectIgnoringOpacity:] (
    self=0x29e3fa8, _cmd=0xff13e7f0, aRect=
        {origin = {x = 0, y = 0}, size = {width = 912, height = 164}})
    at NSView.m:2251
#15 0xfef4ba30 in -[NSView displayIfNeededInRectIgnoringOpacity:] (
    self=0x1fa47f8, _cmd=0xff13e7f0, aRect=
        {origin = {x = 1, y = 1}, size = {width = 912, height = 164}})
    at NSView.m:2276
---Type <return> to continue, or q <return> to quit---
#16 0xfef4ba30 in -[NSView displayIfNeededInRectIgnoringOpacity:] (
    self=0x218fdf8, _cmd=0xff13e7f0, aRect=
        {origin = {x = 0, y = 0}, size = {width = 929, height = 201}})
    at NSView.m:2276
#17 0xfef4ba30 in -[NSView displayIfNeededInRectIgnoringOpacity:] (
    self=0x21bd3d0, _cmd=0xff13e7f0, aRect=
        {origin = {x = 0, y = 0}, size = {width = 949, height = 513}})
    at NSView.m:2276
#18 0xfef4ba30 in -[NSView displayIfNeededInRectIgnoringOpacity:] (
    self=0xc1d1c8, _cmd=0xff13e7f0, aRect=
        {origin = {x = 0, y = 0}, size = {width = 951, height = 544}})
    at NSView.m:2276
#19 0xfef4b54c in -[NSView displayIfNeededInRect:] (self=0xc1d1c8,
    _cmd=0xff13e7e8, aRect=
        {origin = {x = 0, y = 0}, size = {width = 951, height = 544}})
    at NSView.m:2229
#20 0xfef4b368 in -[NSView displayIfNeeded] (self=0xc1d1c8, _cmd=0xff140a70)
    at NSView.m:2211
#21 0xfef67b44 in -[NSWindow displayIfNeeded] (self=0x71fdb0, _cmd=0xff1404c0)
    at NSWindow.m:2083
#22 0xfef5be88 in -[NSWindow(GNUstepPrivate) _handleAutodisplay] (
    self=0x71fdb0, _cmd=0xff1404e0) at NSWindow.m:134
#23 0xfef5bfc8 in +[NSWindow(GNUstepPrivate) _handleAutodisplay:] (
---Type <return> to continue, or q <return> to quit---
    self=0xff106304, _cmd=0xff1404f0, bogus=0x0) at NSWindow.m:173
#24 0xfde5d9fc in -[NSObject performSelector:withObject:] (self=0xff106304, _cmd=0xfe1a38ac, aSelector=0xff1404f0, anObject=0x0) at NSObject.m:1947 #25 0xfdeaf5d8 in -[GSRunLoopPerformer fire] (self=0x8090e0, _cmd=0xfe1a3964)
    at NSRunLoop.m:111

NSTableView.m:
=================
- (void)validateEditing
{
  if (_textObject)
    {
      NSFormatter *formatter = [_editedCell formatter];
      NSString *string = AUTORELEASE ([[_textObject text] copy]);
      id newObjectValue = string;
      BOOL validatedOK = YES;

      if (formatter != nil)
        {
          NSString *error;

          validatedOK = [formatter getObjectValue:&newObjectValue
                                        forString:string
                                 errorDescription:&error];
NSLog(@"validatedOK %d string '%@' --> %@ %@", validatedOK, string, newObjectValue, NSStringFromClass([newObjectValue class]));

          if (!validatedOK)
            {
              newObjectValue = nil;

if ([_delegate respondsToSelector:@selector(control:didFailToFormatString:errorDescript ion:)])
                {
validatedOK = [_delegate control:self didFailToFormatString:string errorDescription:error];
                }
              else if ([string isEqualToString:@""])
                {
                  validatedOK = YES;
                }
            }
        }

      if (validatedOK)
        {
         if (formatter) [_editedCell setObjectValue:newObjectValue];
         else [_editedCell setStringValue:newObjectValue];
        
          if (_dataSource_editable)
            {
              NSTableColumn *tb;
        
              tb = [_tableColumns objectAtIndex: _editedColumn];
        
              [self _setObjectValue: newObjectValue
                    forTableColumn: tb
                    row: _editedRow];
            }
        }
    }
}

Regards,

 Andreas






reply via email to

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