The best comparison I found in docs for describe my app is a “Master-Detail Interface”.
Consider that the “nervous central system” of my application is a NSArrayController. There is a set of detailed objects (NSMutableDictionaries that I call “cards”) with keyed visual elements (texts, icon, sound and so on), arranged into the NSMutableArray of the controller.
The “current card”, visible in the editor, has its keyed properties bound to interface views. It corresponds to the current selection of the NSArrayController.
So far, I have avoided to set any of these properties by code. But one of these properties (of course I could leave it) is the background color of the card. I could set it by calling my gWindow’s or my gTextView’s background color method (as views don’t draw anything, they can’t set a color, unless I override the drawRect method, and I don’t know how to do that).
If I call these methods, from what handler shall I do it? some of a “on cardEntry_(aNotification)” ? or even worse, a “on goToCard (theID)” ?
I can’t really say, since I still don’t understand the whole work flow of the app. Is there only one card visible at a time? Or, are there multiples, but only one is key? If you want the current card to have a different background color, it seems you should change the color when the card becomes the “current card”, however you make that happen.
Is it a way to join screen shots to the posts? If yes, we could save time.
There is one array:
7 /------------> property long text - bound to text view
18 ← this one is selected (the “key”) -------------> property icon - bound to an image well
56 ------------> property bkColor - bound to a color well
MODEL CONTROLLER VIEW
I told you my app was complex - but maybe I making it more complex that it should
Nevertheless, it’s now a lot LESS complex that it was one month ago. And therefore with cocoa there is a lot more efficient that my app 10 years ago.
As the folder is open, the editor brings on the “first” card (in fact, the smallest ID) that he finds. From here the user has the choice
to navigate with menu commands or buttons : first, previous, next, and last.
to open a drawer and click in the list the card that he wants.
Both manners affect the selection of the controller. So there is no “go to card” in the code. As selection changes, the interface, bound to the array controller’s selection’s keys, automatically updates the different views: the current text in the text view, the icon in the image well, and so on. As the user edits the card, the NSMutableDictionary is updated as well.