bug-gnustep
[Top][All Lists]
Advanced

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

NSWindowController bug?


From: Ludovic Marcotte
Subject: NSWindowController bug?
Date: Wed, 3 Oct 2001 23:03:10 -0400 (EDT)

Hi,

In NSWindowController: - (void) _windowWillClose: 
                                (NSNotification *)notification

We have:

if ([notification object] == _window)
    {
      if ([_window delegate] == self) 
        {
          [_window setDelegate: nil];
        }
      if ([_window windowController] == self) 
        {
          [_window setWindowController: nil];
        }
      
      ...

and I think we should have:

if ([notification object] == _window)
    {
      if ([_window isReleasedWhenClosed])
        {
          if ([_window delegate] == self) 
            {
              [_window setDelegate: nil];
            }
          if ([_window windowController] == self) 
            {
              [_window setWindowController: nil];
            }
          
          _window = nil;
        }
      
      [_document _removeWindowController: self];
    }

Otherwise, we remove the delegate and the window controller even if this
window could be shown again with [myWindowControllerObject
showWindow: ...] (think of a singleton) to respond to various events on
various GUI components that have the [_window windowController] as
their target/delegate. 

Should it work like that or classes that don't want this behavior should
implement 

- (void) windowWillClose: (NSNotification *) theNotification
{
 ..
}

in the NSWindowController subclasses and set back the delegate and the
window controller?

Thanks a lot,

Ludovic

-- 
Live as if you were to die tomorrow.
Learn as if you were to live forever.
 - Gandhi




reply via email to

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