On 11-Feb-09, at 23:11 , Graham Cox wrote:


On 12 Feb 2009, at 3:04 pm, Louis Demers wrote:

I do not care about sticking with that paradigm of one window per camera, but I'm conformable with that approach. But how to I get all the sliders and gui elements of my palettes to now bind to the object/camera that is selected.

In my current app, in the bindings inspector of the gui element, I select my instantiated object in the bind to popup and enters the model key path to the key of my object I want to control/display. That works because the instantiated object in unique and in my MainMenu.xib.

But in the above scenarios, how do I configure my binding ? the key is the same all over, but the bound object will be swapped by whatever selection process I end up using. Or do I have hit a limit of the binding mechanism. I doubt it, more likely a limit of my own understanding of bindings 8-)


OK, I understand your question. I'm not in a good position to answer it definitively as I haven't used bindings myself - I still tend to do things using KVO directly since my current project predates bindings.

However, in general, I think what you need to is to have a single controller object that you bind your controls to, and swap the connection to the data model object that represents the selected camera. Then when the camera is switched you are changing just that one object reference, not all the individual bindings. I believe that generic controllers such as NSArrayController will handle that pretty much for you - you just bind to 'selection.whatever' (bondage experts please correct any misinformation here).

So the controller manages to reconnect the bindings to the selected objects. ! That would make sense. All that's left if to figure out the implementation details and coerce IB to do what I want. I'll try building a small test app.

That could also permit you to have a multiple selection of cameras and control several simultaneously if that makes sense for you.

that would definitively be a plus. The app is designed for calibrating and measuring performance of our cameras. Sending the same settings to multiple cameras would be an interesting capability during quality control.


Thanks for the cue, I'll keep investigating.



Louis Demers eng.
www.obzerv.com


_______________________________________________

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

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

Reply via email to