Cursor

Description These functions are used to create and destroy cursors. There is a number of standard cursors, but it is also possible to construct new cursors from pixmaps and pixbufs. There may be limitations as to what kinds of cursors can be constructed on a given display, see gdk_display_supports_cursor_alpha(), gdk_display_supports_cursor_color(), gdk_display_get_default_cursor_size() and gdk_display_get_maximal_cursor_size(). Cursors by themselves are not very interesting, they must be be bound to a window for users to see them. This is done with gdk_window_set_cursor() or by setting the cursor member of the GdkWindowAttr struct passed to gdk_window_new().

Constructors

this
this(GdkCursor* gdkCursor)

Sets our main struct and passes it to the parent class

this
this(GdkCursorType cursorType)

Creates a new cursor from the set of builtin cursors for the default display. See gdk_cursor_new_for_display(). To make the cursor invisible, use GDK_BLANK_CURSOR.

this
this(Pixmap source, Pixmap mask, Color fg, Color bg, int x, int y)

Creates a new cursor from a given pixmap and mask. Both the pixmap and mask must have a depth of 1 (i.e. each pixel has only 2 values - on or off). The standard cursor size is 16 by 16 pixels. You can create a bitmap from inline data as in the below example.

this
this(Display display, Pixbuf pixbuf, int x, int y)

Creates a new cursor from a pixbuf. Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions gdk_display_supports_cursor_alpha() and gdk_display_supports_cursor_color() can be used to determine whether RGBA cursors are supported; gdk_display_get_default_cursor_size() and gdk_display_get_maximal_cursor_size() give information about cursor sizes. If x or y are -1, the pixbuf must have options named "x_hot" and "y_hot", resp., containing integer values between 0 and the width resp. height of the pixbuf. (Since: 3.0) On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension. Since 2.4

this
this(Display display, string name)

Creates a new cursor by looking up name in the current cursor theme. Since 2.8

this
this(Display display, GdkCursorType cursorType)

Creates a new cursor from the set of builtin cursors. Since 2.2

Members

Functions

doref
Cursor doref()

Adds a reference to cursor.

getCursorStruct
GdkCursor* getCursorStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getCursorType
GdkCursorType getCursorType()

Returns the cursor type for this cursor. Since 2.22

getDisplay
Display getDisplay()

Returns the display on which the GdkCursor is defined. Since 2.2

getImage
Pixbuf getImage()

Returns a GdkPixbuf with the image used to display the cursor. Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. In this case, NULL is returned. Since 2.8

getStruct
void* getStruct()

the main Gtk struct as a void*

unref
void unref()

Removes a reference from cursor, deallocating the cursor if no references remain.

Variables

gdkCursor
GdkCursor* gdkCursor;

the main Gtk struct

Meta