Magic-7.3 Command Reference

#

## setpoint

Set the value of the cursor reference point in a specific window.

to x,y in window WID setpoint [x y [WID]]

### Usage:

> setpoint [x y [window_id]

> > where x and y are screen coordinates and window_id is the identifying number for a layout window.

### Summary:

> The setpoint command forces the reference point for a specific window. Each command that executes relative to a window must be able to translate from the pointer position to a layout coordinate. Commands that are executed from a script or from the command-line may not have access to the pointer, but can set the reference point with this command so that the effect of the command is predictable.

> Normally, this command is not used; scripts avoid the command options that operate in reference to the pointer position.

### Implementation Notes:

> setpoint is implemented as a built-in window command in magic.

### Bugs:

> The use of the window ID number is unique to this command and should be a window name like every other window-related command. Likewise, scripts would best make use of this command if the position were in layout coordinates, and magic translated them back to screen coordinates in the indicated window to set the reference point.

Return to command index

Last updated: October, 2004