Question

I'm facing the following problems:

  • We have meta data for items, each item can be a different type of NSControl, currently NSTokenField and NSTextField, but we might need NSCombo or other types. I need to build a form in which each entry will have a label and an editable control. this form has to be built dynamically since the items are retrieved from the server.

I've implemented it with NSMatrix, and apart from it looking pretty shabby, I'm faced with some visual issues I don't know how to solve.

The visual issue is every time I move the mouse over the NSTextFieldCell the tokens get drawn on the top left corner of the NSMatrix form.

now, I'm considering moving to another type of control,

I've googled for few hours, and found the following controls: NSForm, NSMatirx (parent of NSForm), NSCollectionView, NSTableView

which one of these is the most appropriate for this task?

I hope I am clear since I wanted to add pictures, but it wouldn't let me due to lack of "reputation points".

Thanks for your help, Eyal.

Was it helpful?

Solution

NSTokenField is a subclass of NSTextField so you could use an NSTableView to display them.

You could also draw a custom NSCell with all elements in it. When each "item" has a different number of elements then this becomes a bit more complicated though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top