You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Phillip Ganir <ph...@yahoo.com> on 2006/06/07 09:55:14 UTC

Changing Mouse Cursor

Hi,

     I'm having problems on changing the appearance of the mouse cursor when 
an event happens. I have an svg element on a JSVG Canvas, rect to be exact, 
and I want to change the cursor whenever I click on the parts of the
rectange. I want crosshair if I click the middle, and w-resize and e-resize 
when clicking the edge. I already have my event listeners on the rectangle and 
i want it to go with the mousemove event.

     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"/>

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

     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.

     I would really appreciate answers from you. Thank you very much in 
advance.

Phillip




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