Cursor Molecule

Add customized mouse cursor.

Preference Dialog

Properties

type

string, ( r )

Type of this molecule, cursor.

pref.name

string, ( r )

The scriptable name for this molecule.  This name can be set using rename function dynamically.

pref.enableWhen

string, ( r, w )

Specifies the event that activates this molecule.  Default is load.

pref.disableWhen

string, ( r, w )

Specifies the event that deactivates this molecule.  Default is none.

pref.cursor

string, ( r, w )

Specifies the name of the system cursor (e.g. default, pointer, crosshair, etc.).

pref.cursorURL

string, ( r, w )

Specifies the path to a custom cursor image.

pref.isCurstomCursor

bool, ( r, w )

Specifies whether to use the custom or system cursor.

pref.ox

int, ( r, w )

Specifies the offset in x coordinate to the cursor hotspot.

pref.oy

int, ( r, w )

Specifies the offset in y coordinate to the cursor hotspot.

Functions

attach

attach(droplet);

Attach this molecule to the given droplet.

Parameters

droplet(object) a droplet.

Returns

N/A

detach

detach();

Remove this molecule from its droplet.

Parameters

N/A

Returns

N/A

delete

delete();

Delete this molecule.

Parameters

N/A

Returns

N/A

rename

rename(name);

Rename this molecule.

Parameters

name(string) a new name.

Returns

N/A

refresh

refresh();

Forces molecule to redraw with the current set of preferences.

Parameters

N/A

Returns

N/A

clone

clone();

Create a clone of this molecule.

Parameters

N/A

Returns

(object) a molecule.

serialize

serialize();

Serialize this molecule into its JSON representation.

Parameters

N/A

Returns

(string) JSON representation of a molecule.

setCursor

setCursor(url, x, y);

Set the cursor using an external URL or a name to a system cursor.  If x and y are not null, use them to offset the cursor hotspot.

Example:
  setCursor('pointer');
  setCursor('http://www.example.com/cursor.png', 25, 25);

Parameters

url(string) the url of a cursor image or the name of a system cursor.
x(int) hotspot offset in x direction.
y(int) hotspot offset in y direction.

Returns

N/A

Close