play with picture
Posted: Wed May 12, 2010 3:28 pm
Hello guys,
could you help me a little bit please?
I want to learn affairs . I mean.... I draw circle with red color.
I need to know, how to implement this: when I click at this circle, it will change the color to black . And when I click again, it will change it back to red.
Could you paste me the code for this pls ?
method for click should be:
could you help me a little bit please?
I want to learn affairs . I mean.... I draw circle with red color.
I need to know, how to implement this: when I click at this circle, it will change the color to black . And when I click again, it will change it back to red.
Could you paste me the code for this pls ?
method for click should be:
Code: Select all
(defmethod send-mouse-down ((w window) button x y)
(window-mouse-down w
button
(move (make-instance 'point) x y)))
Code: Select all
(defmethod install-callbacks ((w window))
(mg:set-callback (slot-value w 'mg-window)
:display (lambda (mgw)
(declare (ignore mgw))
(redraw w)))
(mg:set-callback
(slot-value w 'mg-window)
:mouse-down (lambda (mgw button x y)
(declare (ignore mgw))
(send-mouse-down w button x y)))
w)
Code: Select all
(defmethod window-mouse-down ((w window) button position)
w)