
13
Cursors
A cursor is an image that tracks the mouse on the display. Each window has its own cursor
which you can change. There are some cursors defined by OPEN LOOK that correspond to
specific window manager operations such as resizing or dragging windows. For these cases,
you cannot redefine a cursor. However, for windows in your application, you can assign any
cursor image you like.
13.1 Creating Cursors
To use the CURSOR package, include the header file <xview/cursor.h>. It provides the neces-
sary types and definitions for using the package. The cursor object’s type is Xv_Cursor.
Figure 13-1 shows the class hierarchy for a cursor object.
Figure 13-1. Cursor class hierarchy
In general, to create a cursor, create an image and a cursor using that image as the
CURSOR_IMAGE data:
Server_image svr_image;
Xv_Cursor cursor;
cursor = (Xv_Cursor)xv_create(owner, CURSOR,
CURSOR_IMAGE, svr_image,
NULL);
The owner of the cursor may be any XView object. The root window associated with the
XView object is used internally by the CURSOR package. If NULL, then the root window of
the default screen is used.
Cursors
Cursors 327