Re: dragging NSTableColumn to another table
Re: dragging NSTableColumn to another table
- Subject: Re: dragging NSTableColumn to another table
- From: Chuck Soper <email@hidden>
- Date: Tue, 19 Feb 2013 18:27:56 -0800
- Thread-topic: dragging NSTableColumn to another table
On 2/19/13 5:54 PM, "Graham Cox" <email@hidden> wrote:
>On 20/02/2013, at 12:10 PM, Chuck Soper <email@hidden> wrote:
>
>> Thanks for your very thorough response. It sounds possible, but quite
>> labor intensive. So much so, that I think that I should not be using
>> NSTableView. I was using NSTableView, with one row, as way to
>>horizontally
>> scroll custom views. To auto adjust the height of the single row I added
>> an observer for NSViewFrameDidChangeNotification on the NSTableView
>> object. Then called setRowHeight: to
>> scrollView.documentVisibleRect.size.height as the table was resized.
>>
>> This was pretty fast to implement and worked fine. I think that this
>>could
>> have been a good way to make use of a table view except for needing to
>> customize the headerCell and implement custom column dragging. I think
>> that I'll just use an NSScrollView and avoid customizing NSTableView.
>
>
>Yeah, sounds to me like you're gaining next to nothing from NSTableView.
>Just implement the whole thing as a custom view containing other custom
>views (of a different or the same kind). In fact, I just did that for
>something almost identical except it's vertical rather than horizontal. I
>implemented drag and drop reordering in almost exactly the way I
>described and there wasn't too much to it - I even have the animation
>working nicely where an appropriate gap opens up to accommodate the
>dropped item. The main thing I ran into there was that using Core
>Animation (via [NSView animator]) to change frame origins and sizes was
>more troublesome than doing my own animations.
>
>Unfortunately I can't share as a) it's commercial code and b) it's
>probably too rough for public consumption.
>
>--Graham
Excellent. I think I have a good solution. The custom container view I
implement will likely be the documentView within an NSScrollView. Thanks
for all your feedback including mentioning different options for animation.
I was going to ask if you used autolayout to place and resize items within
your container view, but since you're changing frame origins and sizes I'm
sure you're not. I'm about to post a question about whether to use
autolayout in this scenario. At this moment I'm planning to just change
frame origins and sizes because it seems more straightforward than trying
to use autolayout.
Chuck
_______________________________________________
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