G'day,
I think my mental model of Cells is wrong. Perhaps someone can help.
I have two model classes:
(defmodel model () ((item-index :initarg :item-index :accessor item-index)) (:default-initargs :item-index (c-in 0)))
(defmodel view () ((item-index :initarg :item-index :accessor item-index)) (:default-initargs :item-index (c-in 0)))
What I would like to do is to connect the item-index slot of an instance of MODEL to the item-index in an instance of VIEW. i.e.
(defun connect-model-and-view (model view) (setf (item-index view) (c? (item-index model))))
which does not appear to be possible.
I have navigated around the issue by introducing a third model class, CONTROLLER, that has an item-index slot initialised with (c? (item-index (^model))) and an observer that updates the view. However, I am wondering if this is the correct way as I seem to require inserting WITH-INTEGRITY in the observer.
Thanks Mark