Hello,

here is a fix for NSView (cvs version from 2000-08-14):
[NSView removeFromSubview:] checks if aSubview is the first responder.
With the patch the method checks if any subview of aSubview is the first  
responder. This happens for TextFields, Cells ...


2000-08-19 Georg Fleischmann

        * gui/Source/NSView.m
        ([NSView removeSubview:]):
        check if any superview of the first responder is the view to be removed


*** gui/Source/NSView.m Sat Aug 19 17:08:57 2000
--- gui/Source/NSView.m.old     Sat Aug 19 16:32:55 2000
***************
*** 396,417 ****
  }

  - (void) removeSubview: (NSView*)aSubview
! { id view;
!
    /*
     * This must be first because it invokes -resignFirstResponder:,
     * which assumes the view is still in the view hierarchy
     */
!   for( view = [_window firstResponder];
!        view != nil && [view respondsToSelector:@selector(superview)];
!        view = [view superview] )
!   {
!     if (view == aSubview)
      {
        [_window makeFirstResponder: _window];
-       break;
      }
-   }
    aSubview->_super_view = nil;
    [aSubview viewWillMoveToWindow: nil];
    [_sub_views removeObjectIdenticalTo: aSubview];
--- 396,410 ----
  }

  - (void) removeSubview: (NSView*)aSubview
! {
    /*
     * This must be first because it invokes -resignFirstResponder:,
     * which assumes the view is still in the view hierarchy
     */
!   if ([_window firstResponder] == aSubview)
      {
        [_window makeFirstResponder: _window];
      }
    aSubview->_super_view = nil;
    [aSubview viewWillMoveToWindow: nil];
    [_sub_views removeObjectIdenticalTo: aSubview];


---
 *  Georg Fleischmann
  * vhf interservice GmbH
  * research and development on self-similarity and geometry of fractals
 *  [EMAIL PROTECTED]

Reply via email to