Toggle-ncs-ghosts-script

From CCP4 wiki
Revision as of 22:28, 19 June 2008 by Emsley (talk | contribs) (New page: <pre> ;; this bind the "g" key: (add-key-binding "Toggle Ghosts" "g" (lambda () (let ((keyboard-ghosts-mol (let ((ls (model-molecule-list))) ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

;; this bind the "g" key:
(add-key-binding "Toggle Ghosts" "g"
         (lambda ()
           (let ((keyboard-ghosts-mol
              (let ((ls (model-molecule-list)))
                (let loop ((ls ls))
                  (cond
                   ((null? ls) -1)
                   ((ncs-ghosts (car ls))
                (car ls))
                   (else
                (loop (cdr ls))))))))
             (if (= (draw-ncs-ghosts-state keyboard-ghosts-mol) 0)
             (set-draw-ncs-ghosts keyboard-ghosts-mol 1)
             (set-draw-ncs-ghosts keyboard-ghosts-mol 0)))))