FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   Custom cursors
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Custom cursors  (Read 406 times)
Jonathan Harris

WWW
Custom cursors
« on: Sep 10th, 2004, 9:29am »

Hi there,
 
Is there any way to get some of the more obscure custom cursors into Processing? The documentation lists: ARROW, CROSS, HAND, MOVE, TEXT, and WAIT as legal cursors, but what about some of the other ones, legal in CSS, but not documented by Processing?
 
Specifically, I need to use the RESIZE cursors (N-RESIZE, S-RESIZE, NE-RESIZE, etc), which are legal in CSS (http://www.pageresource.com/dhtml/csstut10.htm).  
 
The combination of noCursor() and using a BImage at mouseX and mouseY won't suffice, as I need to publish this application online, and noCursor() fails online.
 
Anyone know how I could get these RESIZE cursors into Processing?  
 
Thanks,
Jon
 

--
Jonathan Harris
Number27 >> http://www.number27.org
amoeba

WWW
Re: Custom cursors
« Reply #1 on: Sep 10th, 2004, 11:27pm »

Hi Jonathan, Marius here, we met in Linz this weekend.
 
As you already discovered, you can't use noCursor for online use. You should however be able to use Java's java.awt.Cursor class, see the API documentation here. All you need to do is something like the following:
 
Code:
setCursor(java.awt.Cursor.HAND_CURSOR);

 
Obviously, by replacing HAND_CURSOR with one of the other default cursors you should be able to get the correct cursors displayed. This should work even with the Java 1.1 VM, but as usual you'll have to find out for yourself...
 

marius watz // amoeba
http://processing.unlekker.net/
Jonathan Harris

WWW
Re: Custom cursors
« Reply #2 on: Sep 11th, 2004, 5:32pm »

Hey Marius,  
 
Good to here from you, and thanks for coming to the rescue! The exact command that ended up working was:
 
setCursor(Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR));
 
With that syntax, it's possible to get any of the custom cursors into your Processing applet. Problem solved!
 
Thanks again.
Jon
 

--
Jonathan Harris
Number27 >> http://www.number27.org
Pages: 1 

« Previous topic | Next topic »