xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Neumann <neum...@karto.baug.ethz.ch>
Subject Re: On Changing the Mouse Cursor Appearance
Date Sat, 10 Jun 2006 13:35:49 GMT

>     I tried including a cursor attribute in the rect element, such as:
>
>     <rect id="BaseRectangle" x="0" y="0" height="300" width="515" fill="red" 
>cursor="default"/>
>
>  
>
yes, that cursor attribute is correct. But it is not clear from your 
example whether you have an event listener attached or not. You could 
either do it by using the "on..." event handler attributes or by using 
elt.addEventListener(listenertype,functionOrObject,bubblingOrCapturephase);


>    and I change the attribute's value to a type I want in the event handler:
>
>     ( (Element) evt.getTarget() ).setAttribut("cursor", "w-resize" );
>
>  
>
the correct syntax would be:

evt.target.setAttributeNS(null,"cursor","w-resize");

depending on what you want to do it might also make sense to have the 
event listener not on the rectangle but on the document or a parent 
group or an invisible element that is slightly bigger than your 
rectangle, because you probably want to set the cursor also on the edge 
or slightly outside the rectangle within a sensitive edge around the 
rectangle.

>     Is there anything I'm doing wrong or anything I'm lacking to do?
>
>     I also tried including cursor and pointer-events (with value "fill")
>attribute at the svg (root) element and also the latter to the rect element, 
>but nothing changes.
>  
>
no need to set the pointer-events attribute. The default value is "fill" 
anyway.

Andreas

-- 
----------------------------------------------
Andreas Neumann
Institute of Cartography
ETH Zurich
Wolfgang-Paulistrasse 15
CH-8093  Zurich, Switzerland

Phone: ++41-44-633 3031, Fax: ++41-44-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message