## CURSOR (non inheritable)

Defines the element's cursor.

### Value

Name of a cursor.

It will check first for the following predefined names:

|  | Name
--- | --- | ---
|  | "NONE" or "NULL"
| --- | "APPSTARTING" (Windows Only)
|  | "ARROW"
|  | "BUSY"
|  | "CROSS"
|  | "HAND"
|  | "HELP"
|  | "MOVE"
| --- | "NO" (Windows Only)
|  | "PEN" (*)
|  | "RESIZE_N"
|  | "RESIZE_S"
|  | "RESIZE_NS"
|  | "RESIZE_W"
|  | "RESIZE_E"
|  | "RESIZE_WE"
|  | "RESIZE_NE"
|  | "RESIZE_SW"
|  | "RESIZE_NW"
|  | "RESIZE_SE"
|  | "SPLITTER_HORIZ"
|  | "SPLITTER_VERT"
|  | "TEXT"
|  | "UPARROW"

Default: "ARROW"

(*) To use this cursor on Windows, the iup.rc file, provided with IUP, must be linked with the application (except when using the IUP DLL).

The Windows SDK recommends that cursors and icons should be implemented as resources rather than created at run time.

The GTK cursors have the same appearance of the X-Windows cursors. Althought GTK cursors can have more than 2 colors depending on the X-Server.

If it is not a pre-defined name, then will check for other system cursors. In Windows the value will be used to load a cursor form the application resources. In Motif the value will be used as a X-Windows cursor number, see definitions in the X11 header "cursorfont.h". In GTK the value will be used as a cursor name, see the GDK documentation on Cursors.

If no system cursors were found then the value will be used to try to find an IUP image with the same name. Use IupSetHandle to define a name for an IupImage. But the image will need an extra attribute and some specific characteristics, see notes below.

### Notes

For an image to represent a cursor, it should has the attribute "HOTSPOT" to define the cursor hotspot (place where the mouse click is actually effective). The default value is "0:0".

Usually only color indices 0, 1 and 2 can be used in a cursor, where 0 will be transparent (must be "BGCOLOR"). The RGB colors corresponding to indices 1 and 2 are defined just as in regular images. In Windows and GTK the cursor can have more than 2 colors. Cursor sizes are usually less than or equal to 32x32.

The cursor will only change when the interface system regains control or when IupFlush is called.

The Windows SDK recommends that cursors and icons should be implemented as resources rather than created at run time.

When the cursor image is no longer necessary, it must be destroyed through function IupDestroy. Attention: the cursor cannot be in use when it is destroyed.

### Affects

IupDialog, IupCanvas

### See Also

IupImage