mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 03:40:47 +00:00
set released when closed
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17703 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
695a9abf04
commit
4ecf1a67d3
2 changed files with 29 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2003-09-22 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSWindowController.m (-setWindow:): Set window's
|
||||||
|
releaseWhenClosed when document is not nil. Add documentation.
|
||||||
|
|
||||||
2003-09-21 Fred Kiefer <FredKiefer@gmx.de>
|
2003-09-21 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/NSPopUpButtonCell.m
|
* Source/NSPopUpButtonCell.m
|
||||||
|
|
|
@ -144,6 +144,11 @@
|
||||||
return _owner;
|
return _owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Sets the document associated with this controller. A document
|
||||||
|
automatically calls this method when adding a window controller to
|
||||||
|
its list of window controllers. You should not call this method
|
||||||
|
directly when using NSWindowController with an NSDocument
|
||||||
|
or subclass. */
|
||||||
- (void) setDocument: (NSDocument *)document
|
- (void) setDocument: (NSDocument *)document
|
||||||
{
|
{
|
||||||
// As the document retains us, we only keep a week reference.
|
// As the document retains us, we only keep a week reference.
|
||||||
|
@ -161,7 +166,13 @@
|
||||||
[_window setReleasedWhenClosed: NO];
|
[_window setReleasedWhenClosed: NO];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
[_window setReleasedWhenClosed: YES];
|
{
|
||||||
|
/* When a window owned by a document is closed, it is released
|
||||||
|
and the window controller is removed from the documents
|
||||||
|
list of controllers.
|
||||||
|
*/
|
||||||
|
[_window setReleasedWhenClosed: YES];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) document
|
- (id) document
|
||||||
|
@ -275,6 +286,8 @@
|
||||||
return _window;
|
return _window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Sets the window that this controller managers to aWindow. The old
|
||||||
|
window is released. */
|
||||||
- (void) setWindow: (NSWindow *)aWindow
|
- (void) setWindow: (NSWindow *)aWindow
|
||||||
{
|
{
|
||||||
NSNotificationCenter *nc;
|
NSNotificationCenter *nc;
|
||||||
|
@ -304,10 +317,17 @@
|
||||||
name: NSWindowWillCloseNotification
|
name: NSWindowWillCloseNotification
|
||||||
object: _window];
|
object: _window];
|
||||||
|
|
||||||
|
/* For information on the following, see the description in
|
||||||
|
-setDocument: */
|
||||||
if (_document == nil)
|
if (_document == nil)
|
||||||
{
|
{
|
||||||
[_window setReleasedWhenClosed: NO];
|
[_window setReleasedWhenClosed: NO];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[_window setReleasedWhenClosed: YES];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue