Toggle-ncs-ghosts-script

From CCP4 wiki
Revision as of 00:28, 20 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)
Jump to navigation Jump to search

;; 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)))))