I’m wrapping a few Cocoa controls in pure Xojo (NSToolbar, NSToolbarItem, NSToolbarItemGroup, NSTableView, NSOutlineView, NSPredicateEditor, and some more).
I’ve now finished the Toolbar related stuff I have developed several versions as a test.
Before I start working on the other controls, I have to decide how to translate Cocoa’s delegate / protocol architecture to Xojo. These are the possibilities I could come up with:
interface: close to Cocoa, the delegate can be a separate class or the control class
delegate class: close to Cocoa, but the delegate must be a separate class
events: still kind of like in Cocoa, but the delegate is always the control class
properties and methods: completely different (NSTableView would have an API very close to Listbox)
The big gap is of course between the first/second/third (“Being asked” the Cocoa way) and the fourth item (“Telling” the Xojo way) of my list. What would you prefer as a developer using such a control?