Skip navigation.
 
mlChanging frame inside of NSCollectionView
FROM : Tim Davis
DATE : Thu Nov 08 23:52:50 2007

Hey all,

I'm using NSCollectionView in a pet project of mine and I'm using it 
to create a list of items.  I've got the NSView drawing already 
complete but I'm having issues trying to resize it once it's in the 
Collection View.  Pretty much what I'm doing is this...I'm trying to 
keep it minimalistic, if the user selects an item it expands showing 
some extra optional information that was previously hidden.

I've tried setting the frame with the following code...(which resides 
inside of the view I'm resizing)

...
NSRect oldFrame = [self frame];
NSRect newFrame = NSMakeRect( oldFrame.origin.x, oldFrame.origin.y, 
NSWidth(oldFrame), NSHeight(oldFrame) -100);
   
[self setFrame: newFrame];

[[self superview] setNeedsDisplay: YES];
[self setNeedsDisplay: YES];
...

I even added the [[self superview] setNeedsDisplay: YES] to try and 
get the superview to redisplay/recalculate position of objects.  I've 
tried enlarging the height and shrinking it and it still displays as 
the same thing on screen.

Any ideas?

Thanks,
Tim

Related mailsAuthorDate
mlChanging frame inside of NSCollectionView Tim Davis Nov 8, 23:52
mlRe: Changing frame inside of NSCollectionView listposter Nov 9, 01:11