Re: resizing NSCollectionView enclosed view items
Re: resizing NSCollectionView enclosed view items
- Subject: Re: resizing NSCollectionView enclosed view items
- From: Nicolas Berloquin <email@hidden>
- Date: Sun, 27 Dec 2009 14:02:19 +0100
Some followup (which might help others, but which brings more questions)
While tracing values in the debugger, I noticed that the min/max itemsize
values were
set to the same value inside the NSCollectionView.
It looks like there should only be an itemSize property, since it's not a
range after all...
So, after trial and error, what seems to work is setMinItemSize: and
setMaxItemSize:
to the same, new value, then call setNeedsDisplay (which may not be
necessary
but it doesn't hurt I guess).
getting all NSViews, one at a time, and changing their frame size gives
direct feedback
but is really ugly, since (because of the lame animation) the views are
bound by the frame of the
previous size and only reflect the new size once the setMinMax has been
processed through
a timer animation. That is, they either shrink inside a big rectangle, or
expand and get
hidden by the rect...
I was hoping for something more like the IKImageBrowser...
I could have simply overriden the NSCollectionView class, if only more
mechanics were exposed.
I wonder why apple puts out promissing classes like these, but maims them by
making it impossible to adjust them to our needs. It's "take it or leave
it", and I think
it's quite unfortunate. (I'm not trying to flame here, I'm just a bit
disappointed, and
I'll probably have to rewrite the whole thing myself)
On Sun, Dec 27, 2009 at 1:13 PM, Nicolas Berloquin <email@hidden>wrote:
> Hi !
>
> I'm trying to resize the items displayed inside an NSCollectionView.
> I'm not trying to be too fancy, I'm fine if they're all the same size...
> There are two methods that seem to indicate that resizing should be taken
> into account
> (setMin/MaxItemSize), but when I setFrameSize on the "prototype" NSView
> (not the item prototype)
> nothing happens. I tried sending setNeedsDisplay to the collectionView,
> with no effect.
> And I can't see any method in any of the collectionView hierarchy that
> would tell it to
> either resize the enclosed views, or that they have changed size.
> Is the NSCollectionView halfway built ? (cf setMin/max)
> Am I missing something ?
>
> thanks !
>
>
_______________________________________________
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