cnContactViewControllerMBS - resizing

I’m using MBS’ cnContactViewControllerMBS to show details of cnContactMBS - but the resultant view is too small to show all the contact details - they end up in a very small scrollable area at the bottom.

The basic code is in MBS’ examples /Mac64Bit/Contacts/cnContactViewController test.

I have just locked the right and bottom of the included canvas, and would like the viewController to fill canvas when resized - but it stays the same size at the bottom of the canvas. Presumably something to do with Cocoa coordinates.

You have this?

// show
dim n as NSViewMBS = canvas1.NSViewMBS
v.frame = new NSRectMBS(0, 0, n.frame.Width, n.frame.Height)
n.addSubview v

The example takes size of canvas for the control. Doesn’t this work?

If you like to have it resize dynamically, you could set autoresizingMask.
e.g.

v.autoresizesSubviews = true
n.autoresizesSubviews = true
v.autoresizingMask = v.NSViewWidthSizable + v.NSViewHeightSizable

I added these Christian but still the same result. Images here:


The contactViewController stays at the bottom of the canvas and doesn’t stretch to show all the content.

but did you check the LockTop property of the canvas?

Yes, it is locked all the way around.

I tried it myself.
This thing doesn’t like to be resized at all.
Not sure what Apple did there. Maybe some conflict between auto layout vs. auto resizing.