Re: NSTableView within NSScrollView in code
Re: NSTableView within NSScrollView in code
- Subject: Re: NSTableView within NSScrollView in code
- From: Patrick Mau <email@hidden>
- Date: Wed, 10 Nov 2010 23:09:28 +0100
Hallo Kyle
Thanks for your remarks, but that's not it (unfortunately, see below).
On 10.11.2010, at 22:54, Kyle Sluder wrote:
> On Wed, Nov 10, 2010 at 1:34 PM, Patrick Mau <email@hidden> wrote:
>>
>> Hallo everyone
>>
>> When I embed an NSTableView in an NScrollView, everything works except
>> column auto-resizing.
>>
>> What would trigger automatic column layout whenever the NSScrollView frame
>> is reduced in size?
>
> The columns need to fill the available width of the scrollview before
> the table view considers stretching them.
My test window is 320x240, scrollbars are visible right from the start.
What I don't get is the following:
The scrollview resizes along with my custom view, which is fine.
This triggers a resize of the NSClipView, which is the contentView of the scrollview.
The documentView's frame is obviously not affected.
So someone must tell the tableView that it should resize its colums in response
to a scrollview frame change.
In my custom view I have overwritten "setFrame:" to send the tableView a "sizeToFit".
This works, but causes strange redrawing glitches during live-resize.
This all seems strange to me, because the only thing IB could do is
maybe establish some binding to modify the tableView's frame.
>> I have a custom view that creates a NSScrollView and NSTableView:
>
> Obligatory question: why aren't you doing this in Interface Builder?
It's half a page of code and I'd just like to know whats happening
behind the scenes here.
If you want to take a look, I can prepare you a sample project.
Best regards.
Patrick
_______________________________________________
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