<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
<tt>(define/override (on-event e)<br>
(let ([type (get-event-type e)])<br>
(if (equal? type 'left-down)<br>
(handle-left-click))))<br>
</tt><br>
Define a function called handle-left-click in the same class. That will
run whenever the left mouse button is clicked.<br>
That's on-event in a nutshell, if you need me to be more specific, just
email me again.<br>
<br>
Katsmall the Wise<br>
<br>
The Computer Man wrote:<br>
<blockquote type="cite" cite="mid000c01c3018f$4a89ecd0$0a00000a@tcm">
<pre wrap=""> For list-related administrative tasks:
<a class="moz-txt-link-freetext" href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a>
I'm define this for on-paint fonction
(define $bitmap-canvas%
(class* canvas% ()
(inherit get-dc)
(define/override on-paint
(lambda () (send (get-dc) draw-bitmap $bitmap 0 0)))
(define/override (on-event e)
(send e button-down? 'left))
(super-instantiate())))
I'm add your define for the event, but i don't understand hom i can use it,
for example i'm click with the left button, how can call the function
(on-event e) ? I'm define (define mouse (make-object mouse-event%
'left-down)) ? I'm not understand how catch and use the mouse event when i'm
use it, the function not run
thanks you by advance for your answers
----- Original Message -----
From: "Katsmall the Wise" <a class="moz-txt-link-rfc2396E" href="mailto:kela_bit@netvision.net.il"><kela_bit@netvision.net.il></a>
To: "The Computer Man" <a class="moz-txt-link-rfc2396E" href="mailto:thecomputerman@wanadoo.fr"><thecomputerman@wanadoo.fr></a>
Cc: <a class="moz-txt-link-rfc2396E" href="mailto:plt-scheme@qua.cs.brown.edu"><plt-scheme@qua.cs.brown.edu></a>
Sent: Sunday, April 13, 2003 9:23 AM
Subject: Re: [plt-scheme] Mouse and Canvas Object
</pre>
<blockquote type="cite">
<pre wrap="">You should use
(define my-canvas%
(class canvas%
(define/override (on-event e)
; here you should check what event-type e is, what the buttons
are, and such...
)))
e is of type mouse-event%.
Look for it n the Help Desk.
Good luck!
Katsmall the Wise
The Computer Man wrote:
</pre>
<blockquote type="cite">
<pre wrap=""> For list-related administrative tasks:
<a class="moz-txt-link-freetext" href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a>
Hello,
I have a problem with the management of the mouse into object, I would
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->like
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">to know if there is a documentation, or if somebody could explain me the
operation of the mouse into object, how it is known that there were a
clic...?
Thank you by advance for your answers
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>