Routines (alphabetical) > Routines: B > BOX_CURSOR Procedure

# BOX_CURSOR Procedure

The BOX_CURSOR procedure emulates the operation of a variable-sized box cursor (also known as a “marquee” selector).

Note: BOX_CURSOR does not function properly when used within a draw widget. See the BUTTON_EVENTS and MOTION_EVENTS keywords in WIDGET_DRAW.

This routine is written in the IDL language. Its source code can be found in the file `box_cursor.pro` in the `lib` subdirectory of the IDL distribution.

### Using BOX_CURSOR

Once the box cursor has been realized, hold down the left mouse button to move the box by dragging. Hold down the middle mouse button to resize the box by dragging. (The corner nearest the initial mouse position is moved.) Press the right mouse button to exit the procedure and return the current box parameters.

On machines with only two mouse buttons, hold down the left and right buttons simultaneously to resize the box.

## Syntax

BOX_CURSOR, [ X0, Y0, NX, NY [, /INIT] [, /FIXED_SIZE]] [, /MESSAGE]

## Arguments

### X0, Y0

Named variables that will contain the coordinates of the lower left corner of the box cursor.

### NX, NY

Named variables that will contain the width and height of the cursor, in pixels.

## Keywords

### INIT

If this keyword is set, the arguments X0, Y0, NX, and NY contain the initial position and size of the box.

### FIXED_SIZE

If this keyword is set, NX and NY contain the initial size of the box. This size may not be changed by the user.

### MESSAGE

If this keyword is set, IDL prints a message describing operation of the cursor.

## Version History

Pre 4.0 | Introduced

## See Also

CURSOR Procedure, CURSOR_CROSSHAIR, CURSOR_IMAGE, CURSOR_STANDARD, CURSOR_XY