Package: gdk

Callback gdk:cursor-texture-callback

Syntax

lambda (cursor size scale width height xhotspot yhotspot) => texture

Arguments

cursor -- a gdk:cursor object
size -- an integer for the nominal cursor size, in application pixels
scale -- an double float for the device scale
width -- a foreign pointer to an integer that serves as the return location for the actual cursor width, in application pixels
height -- a foreign pointer to an integer that serves as the return location for the actual cursor height, in application pixels
xhotspot -- a foreign pointer to an integer that serves as the return location for the hotspot X position, in application pixels
yhotspot -- a foreign pointer to an integer that serves as the return location for the hotspot Y position, in application pixels
texture -- a new gdk:texture object

Details

The type of callback used by a dynamic gdk:cursor object to generate a texture for the cursor image at the given size and scale. The actual cursor size in application pixels may be different from size x size, and will be returned in width, height. The returned texture should have a size that corresponds to the actual cursor size, in device pixels, that is application pixels, multiplied by scale.

This function may fail and return nil, in which case the fallback cursor will be used.

Since 4.16
 

See also

2026-02-22