Cursor.newFromSurface

gdk.cursor.Cursor newFromSurface(gdk.display.Display display, cairo.surface.Surface surface, double x, double y)

Creates a new cursor from a cairo image surface.

Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions [gdk.display.Display.supportsCursorAlpha] and [gdk.display.Display.supportsCursorColor] can be used to determine whether RGBA cursors are supported; [gdk.display.Display.getDefaultCursorSize] and [gdk.display.Display.getMaximalCursorSize] give information about cursor sizes.

On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.

Parameters

displaythe #GdkDisplay for which the cursor will be created
surfacethe cairo image surface containing the cursor pixel data
xthe horizontal offset of the “hotspot” of the cursor
ythe vertical offset of the “hotspot” of the cursor

Returns

a new #GdkCursor.