IKImageBrowserViewMBS - add controls?

Using the above Image Browser - is there a way to add other controls (e.g. checkboxes or canvas) to each of the cells and accept mouse clicks - i.e. to be able to treat it like a container?

Well, technically you could of course check what subviews the control has, find the right one and add something to it.

But maybe you would be more happy with NSCollectionViewControlMBS to show your containers?

1 Like

The image browser has a refresh problem on systems above Catalina. It never refreshes properly. The user has to scroll to see the content. But maybe it is just me.

Thanks Christian - I think that’s what I was looking for.

One of the frustrations of things Apple (and presumably others) is finding/remembering the name of the control/class that you want to do a particular job. You know there is one, but blessed if you can find the name.

1 Like

Christian

How can I resize the imagecontainers on the fly?

I am able to resize the NSViews - which updates the graphics elements, but cannot find a way to resize/reposition elements on the container.

I have tried just simply adjusting their widths and heights but this seems to destroy the integrity of the viewer.

I’ve run into the same thing and what I found is that you need to recreate the NSCollectionViewFlowLayoutMBS at the new scale and reassign it to the to the collectionView.collectionViewLayout

That clears everything though, so you’ll have to re-add your containers at the new scale after updating the layout

1 Like

Seems long winded - but it works. Thanks

Agreed. I think that it might just be an unfortunate consequence of having to steal views from containers in order to get this working in Xojo.

I would be curious what the native implementation looks like.

Still having problems with aligning controls within the container.

  1. Controls that are aligned using lockRight, lockBottom etc all seem to work fine.
  2. Controls that are aligned on the fly - e.g. by obj.left, obj.top etc - don’t seem to align as expected.

I’m wondering if it is due to your quoted item. I’ve tried aligning them with the containers NSView.frameTop etc - but not working.

Any clues as to how to achieve this?

I noticed the same thing.

Any controls that I need to dynamically position in code have their coordinates calculated based on the location of other controls in the container that are automatically positioned using locks.

You could also place 0 pixel wide/high canvases around the outer edges of the container that use locks to keep them on the border. Then you could reference those to get the true position of the frame of the container.

I’ve given up trying to get this to work with all the controls I need to move - moviePlayer and livePhotoMBS in particular don’t seem to want to play ball.

I will revert to my previous home-grown control using Xojo standard components. Probably not as fast/smooth but much easier to debug.