Topic: APLX Help : System Classes : Methods : Loadpointer
[ Previous | Next | Contents | Index | APL Home ]

www.microapl.co.uk

The 'Loadpointer' method


Argument: Nested vector - see description
Result: None

Valid for: System

The Loadpointer method can be used to define a new pointer or cursor. The pointer is given a number in the range 100 - 119 which can then be used when setting the pointer property of a visible control, as shown in this example:

      ⍝ Load pointer from file and give it the number 100
      '⎕' ⎕wi 'Loadpointer' 100 'C:\Windows\Cursors\banana.ani'

      ⍝ Set 'mycontrol' to use this as its pointer      
      mycontrol.pointer←100

The pointer only needs to be loaded once and it can then be shared by multiple controls.

Loading a pointer from file

Syntax: '⎕' ⎕WI 'Loadpointer' Number Filename

This form allows a pointer to be loaded from a file. Number is an integer in the range 100 - 119, and Filename is a character vector

Windows: The data in the file must be in either .CUR or .ANI format.

Macintosh and Linux: Loading a cursor from file is not currently supported

Creating a pointer from data

Syntax: '⎕' ⎕WI 'Loadpointer' Number Hostspot_Y Hotspot_X Bitmap Mask

This form allows a monochrome pointer to be specified directly. Bitmap is an M x N boolean matrix, where a 0 represents black and 1 represents white. Mask is a boolean matrix of the same shape, in which a 0 specifies that the corresponding bit in Bitmap is transparent. The position of the pointer hot-spot is given by the Hotspot_Y and Hotspot_X parameters, with 0 0 being the top left corner.

Example:

      cursor←15 15⍴16↑1
      cursor←cursor∨⌽cursor
      '⎕' ⎕WI 'Loadpointer' 100 8 8 (~cursor) cursor

Using a pre-loaded pointer

Syntax: '⎕' ⎕WI 'Loadpointer' Number Handle

This form can be used if you have obtained a handle to a cursor through some other means, for example a ⎕NA call to the operating system. Handle is an integer scalar containing the handle to use.


Topic: APLX Help : System Classes : Methods : Loadpointer
[ Previous | Next | Contents | Index | APL Home ]