Re: 2 questions on Cocoa design and "expected" behavior
Re: 2 questions on Cocoa design and "expected" behavior
- Subject: Re: 2 questions on Cocoa design and "expected" behavior
- From: Neil Earnshaw <email@hidden>
- Date: Wed, 10 Sep 2003 18:52:09 +0100
1) Why is an Utility window always receiving the windowWillClose
notification even when it has never been displayed?
I would guess that when it is loaded from the nib it has the chance to
allocate resources, whether or not it's been displayed. It gets
windowWillClose so that it can release those resources. (That's just a
guess; no-one else responded so I thought I'd have a stab.)
2) Why is the management of selection in NSBrowser completely
different from the one of the other widgets like NSTableView,
NSOutlineView? Mainly, why is not the delegate able to manage the
selection?
The delegate has a chance to influence selection. Check out the
delegate methods, especially:
- (BOOL)browser:(NSBrowser *)sender selectRow:(int)row
inColumn:(int)column
If the delegate implements this then the browser will hand full control
of selection over to it. You can also use the NSBrowser method:
- (void)selectRow:(int)row inColumn:(int)column
To explicitly set the selected cell.
You can also play about with the individual NSBrowserCells as well.
Remember, they inherit from NSCell which provides a ton of methods.
Have you got CocoaBrowser or DocoaBrowser? They are excellent for
trawling through a class's methods and other documentation to find out
what's available. Both are free downloads. (Big thanks to both
developers!)
-Neil
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.