wb_set_cursor

bool wb_set_cursor (int wbobject, mixed source)

Set or change the mouse cursor shape of a window, control, a whole class or application-wide.

The cursor can be set for any window class and for control classes ImageButton, InvisibleArea (deprecated), HyperLink and EditBox.

The source parameter can be a cursor handle from function wb_load_image() or one of the preset system cursors: arrow, cross, finger, forbidden, help, ibeam, null (no cursor), sizeall, sizenesw, sizens, sizenwse, sizewe, uparrow, wait and waitarrow.

Uses

Use this function according to the table below.

wbobject

source

What it does

NULL

NULL

Set the application cursor to the default cursor (arrow).

NULL

Handle

Set the application cursor to the specified cursor handle.

NULL

String

Set the application cursor to the specified cursor name.

Class name

NULL

Set the class cursor to the default cursor (arrow).

Class name

Handle

Set the class cursor to the specified cursor handle.

Class name

String

Set the class cursor to the specified cursor name.

Handle

NULL

Set the window or control cursor to the default class cursor.

Handle

Handle

Set the window or control cursor to the specified cursor handle.

Handle

String

Set the window or control cursor to the specified cursor name.

Returns TRUE on success or FALSE if an error occurs.

Examples

// Set the cursor of a single control

wb_set_cursor($button, 'finger');

// Set the cursor of a single window

wb_set_cursor($button, 'cross');

// Set the cursor for whole classes

$cursor = wb_load_image('finger.cur');
wb_set_cursor(ImageButton, $cursor);
wb_set_cursor(InvisibleArea, $cursor);
wb_set_cursor(HyperLink, $cursor);

// Hide the cursor of the current application

wb_set_cursor(NULL, 'none');

See also

wb_load_image
window classes
System functions