Re: NSTableView within NSScrollView in code
Re: NSTableView within NSScrollView in code
- Subject: Re: NSTableView within NSScrollView in code
- From: Kyle Sluder <email@hidden>
- Date: Thu, 11 Nov 2010 08:52:50 -0800
On Nov 11, 2010, at 4:29 AM, Patrick Mau <email@hidden> wrote:
> After all the setup, I add an observer to the NSClipView
> that is the scrollvies's contentView.
NSTableView already does this exact thing when it is set up properly. There should be no need for you to do this yourself.
>
> The corresponding setup in IB (TableView in ScrollView, which tracks window size),
> creates a scrollview that has both the documentView and the contentView pointing to the
> identical NSClipView (checked with gdb). This setup can not be done in code, setting
> the documentView changes something in the clipView leading to an exception
No, it does not. Otherwise everyone who does this the right way (by using IB) would have broken table views.
>
> I have created a custom TableColumn, implementing "setWidth:" by just calling
> super. If you do so, you can look at the backtrace.
>
> You'll note that the clipView post a frame change notification, which will
> be observed in 'superviewFrameChanged:' in te tableview.
This is NSTableView's implementation of the technique you reimplemented above.
Please, stop trying to do this in code. There are so many things you have to do to get it right, and doing it in code provides you ZERO advantage.
--Kyle Sluder_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden