Using apple sample ImageBrowserAppearance code as a basis, I am trying to
make non-square cells in an IKImageBrowser.

Specifically my cells need to be an aspect ration of 2:1 (wide) instead of
square.

I have overridden:

-(NSRect)imageContainerFrame

-(NSRect)selectionFrame

-(NSRect)frame

In 
-(CALayer *)layerForType:(NSString*) type

I have to use

NSRect backgroundRect = NSMakeRect(0, x, frame.size.width,
frame.size.height);


Where x is NOT zero, but is moved up by the amount that the vertical
dimension of the cell has shrunk. If my cell is 100x50, then x must be 50.

This works, except the vertical spacing between rows is too high as it is
assuming square cells.

I had to correct it with:

[myBrowser setIntercellSpacing:NSMakeSize(10, -40)];

To get a real 10,10 spacing (10 - 50 = -40) using the size above.

This seems all wonky.

Does anyone have a sample of non-square cells in IKImageBrowser?

Thanks,

Trygve



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to