What I'm trying to achieve is to register the left click on a viewport. After performing the click on the viewport, I get an error saying that the application is not a procedure, expecting a procedure that can be applied to arguments
Can anyone guide me on what is wrong with this piece of code?
(define mclick (get-mouse-click vp))
(if (left-mouse-click? mclick)
(if
(and (> (posn-x (mouse-click-posn mclick)) (50))(< (posn-x (mouse-click-posn mclick)) (99))
(> (posn-y (mouse-click-posn mclick)) (50))(< (posn-y (mouse-click-posn mclick)) (99)))
(set! c1 ((draw-solid-rectangle vp) (make-posn 50 50) 50 500 "green"))
)
)