On 09/09/2020 20:28, Guenter Fritz wrote:
Dear all,

just a simple question, but I could not figure it out:

In coot 0.9 (vers. Marina Bay from CCP4 7.1) osx.

Can somebody point me to the option to select the map to attach to the scroll wheel?

(in 0.89 this was HID -> ScrollWheel -> Attach scroll wheel to which map)


Coot-customizers (hot-key users) might like to consider the attached script. As it's names implies, it cycles through the displayed maps one by one - except one of the options is "show all the maps". I have it bound to the Shift-X key, I find it convenient when using multiple maps in cryo-EM building.  I can switch to view the map I want to scroll, scroll that map (if just one map is displayed the scroll wheel will attach itself to that map) and then go back all-maps. This is quicker than opening up the Display Manager and wondering about the molecule index of the map that I want to change.

I got the idea  from Oliver Clarke.


Paul.



########################################################################

To unsubscribe from the COOT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=COOT&A=1

This message was issued to members of www.jiscmail.ac.uk/COOT, a mailing list 
hosted by www.jiscmail.ac.uk, terms & conditions are available at 
https://www.jiscmail.ac.uk/policyandsecurity/
(define (display-cycle-through-maps)

  ;; return an index or #f, lst must be a list
  (define (find-in-list item lst)
    (let loop ((idx 0))
      (cond
       ((= (length lst) idx) #f)
       ((eq? (list-ref lst idx) item) idx)
       (else
	(loop (+ idx 1))))))

  (define (next-map current-map-number map-number-list)
    (let ((current-idx (find-in-list current-map-number map-number-list))
	  (l (length map-number-list)))
      (format #t "current-idx: ~s from list map-number-list ~s~%" current-idx map-number-list)
      (if (number? current-idx)
	  (let ((next-index (if (= (+ current-idx 1) l)
				0
				(+ current-idx 1))))
	    (list-ref map-number-list next-index))
	  (list-ref map-number-list 0))))

  (let ((map-list (map-molecule-list)))
    (let ((current-displayed-maps
	   (filter (lambda(imol)
		     (= (map-is-displayed imol) 1))
		   map-list)))
      (let ((n-displayed (length current-displayed-maps)))

      ;; if nothing is displayed, display the first map in map-list
      ;; if one map is displayed, display the next map in map-list
      ;; if more than one map is displayed, display only the last map
      ;;    in the current-displayed-maps

      (cond
       ((= n-displayed 0) (if (> (length map-list) 0)
			      (undisplay-all-maps-except (car map-list))))
       ((= n-displayed 1) (if (> (length map-list) 1)
                              (let ((nm (next-map (car current-displayed-maps) map-list))
                                    (currently-displayed-map (car current-displayed-maps)))
                                (if (> nm currently-displayed-map)
                                    (undisplay-all-maps-except nm)
                                    (display-all-maps)))))

       (else (undisplay-all-maps-except (car current-displayed-maps))))))))

(add-key-binding "Display Cycle Through Maps" "X" display-cycle-through-maps)

Reply via email to