0

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"))
            )
    )
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • 4
    Did you search for [`"application: not a procedure" site:stackoverflow.com`](https://www.google.com/search?q=%22application%3A+not+a+procedure%22+site%3Astackoverflow.com&oq=%22application%3A+not+a+procedure%22+site%3Astackoverflow.com)? – Joshua Taylor May 27 '14 at 18:30

1 Answers1

4

50 and 99 are not procedures. Therefore, it's invalid to evaluate (50) and (99).

C. K. Young
  • 219,335
  • 46
  • 382
  • 435