AMD64 시스템에서 Linux 용 SBCL로 작업하고 있습니다.
함수 ANIMTEST는 CANVAS 위젯을 사용하여 LTK 창을 인스턴스화합니다. BARRIER와 FOLLOWER의 두 항목이 캔버스에 있습니다. 캔버스의 중앙에 장벽이 있고, 의도 한대로 작동하지 않는 마우스를 따라 가려는 FOLLOWER가 계속 회전합니다. 필자의 첫 번째 시도 (주석 참조)는 마우스의 절대 화면 좌표가 캔버스 내의 상대 좌표로 해석되어 결과가 서로 상쇄되지 않았 음을 나타냅니다. ltk.lisp 및 docs를 통해 검색 한 후 Screen-Mouse-X/Y (두 번째 시도, 주석 참조)를 발견했습니다. 설명서에 따라 Screen-Mouse-X & -Y를 사용하고있는 것처럼 느껴지지만 왜 작동하지 않습니까? = 참고 = ANIMTEST가 들어있는 파일과이를 지원하는 패키지가 오류없이로드되어 실행됩니다. 정의한 함수 (UCTK-BEAM 등)는 테스트를 거쳐 정상적으로 실행됩니다.CANVAS 위젯을 기준으로 마우스 코드에 액세스 할 수 없습니다.
(defun animtest()
"Test a spinning figure in LTK"
(with-ltk()
(let* ((cnvs (make-instance 'canvas :width 400 :height 400))
(barrier (uctk-beam 200 200 40 20))
(follower (uctk-beam 0 40 40 20))
(slp-time 50) ; in ms
(bar-theta 0)
(fol-theta 0))
(labels ((update()
(draw barrier nil)
(draw follower nil)
(incf bar-theta (/ pi 15))
(incf fol-theta (/ pi 15))
(geo:set-theta barrier bar-theta)
(geo:set-theta follower fol-theta)
(geo:set-center follower
;== FIRST ATTEMPT ==
(cons (screen-mouse-x cnvs)
(screen-mouse-y cnvs)))
; == SECOND ATTEMPT ==
;(cons (canvasx cnvs (screen-mouse-x cnvs))
; (canvasy cnvs (screen-mouse-y cnvs))))
(after slp-time #'update)))
(pack cnvs :fill :both :expand 1)
(update)))))
미리 감사드립니다.