CURSOR

IUP - Portable User Interface

CURSOR

Defines the element's cursor.

Value

Name of a cursor.

It will check first for the following predefined names:

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

Default: "ARROW"

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

The GTK cursors have the same appearance of the X-Windows cursors.

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 GdkCursorType, see the GDK documentation.

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 bellow.

Notes

For an image to represent a cursor, it must has the attribute "HOTSPOT" to define the cursor hotspot (place where the mouse click is actually effective). Only color indices 0, 1 and 2 can be used in a cursor, where 0 will be transparent. The RGB colors corresponding to indices 1 and 2 are defined just as in regular images. In Windows 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

In Motif can also be used in other controls.

See Also

IupImage