Class: Gdk::Cursor
- Inherits:
-
Object
- Object
- Gdk::Cursor
- Defined in:
- (unknown)
Overview
A Gdk::Cursor represents a cursor. Its contents are private.
Instance Method Summary collapse
-
#cursor_type ⇒ Gdk::CursorType
Cursor-type.
- #cursor_type=(cursor_type) ⇒ Gdk::CursorType
-
#display ⇒ Gdk::Display
Display.
- #display=(display) ⇒ Gdk::Display
-
#get_surface(x_hot, y_hot) ⇒ cairo::Surface
Returns a cairo image surface with the image used to display the cursor.
-
#image ⇒ GdkPixbuf::Pixbuf
Returns a Gdk::Pixbuf with the image used to display the cursor.
-
#new(cursor_type) ⇒ Gdk::Cursor
Creates a new cursor from the set of builtin cursors for the default display.
-
#new_for_display(display, cursor_type) ⇒ Gdk::Cursor
Creates a new cursor from the set of builtin cursors.
-
#new_from_name(display, name) ⇒ Gdk::Cursor
Creates a new cursor by looking up name in the current cursor theme.
-
#new_from_pixbuf(display, pixbuf, x, y) ⇒ Gdk::Cursor
Creates a new cursor from a pixbuf.
-
#new_from_surface(display, surface, x, y) ⇒ Gdk::Cursor
Creates a new cursor from a cairo image surface.
-
#ref ⇒ Gdk::Cursor
Adds a reference to cursor.
-
#unref ⇒ nil
Removes a reference from cursor, deallocating the cursor if no references remain.
Instance Method Details
#cursor_type ⇒ Gdk::CursorType
Returns cursor-type.
#cursor_type=(cursor_type) ⇒ Gdk::CursorType
#display ⇒ Gdk::Display
Returns display.
#display=(display) ⇒ Gdk::Display
#get_surface(x_hot, y_hot) ⇒ cairo::Surface
Returns a cairo image surface 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, nil is returned.
#image ⇒ GdkPixbuf::Pixbuf
Returns a Gdk::Pixbuf 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, nil is returned.
#new(cursor_type) ⇒ Gdk::Cursor
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.
#new_for_display(display, cursor_type) ⇒ Gdk::Cursor
Creates a new cursor from the set of builtin cursors.
#new_from_name(display, name) ⇒ Gdk::Cursor
Creates a new cursor by looking up name in the current cursor theme.
A recommended set of cursor names that will work across different platforms can be found in the CSS specification:
-
“none”
-
 “default”
-
 “help”
-
 “pointer”
-
 “context-menu”
-
 “progress”
-
 “wait”
-
 “cell”
-
 “crosshair”
-
 “text”
-
 “vertical-text”
-
 “alias”
-
 “copy”
-
 “no-drop”
-
 “move”
-
 “not-allowed”
-
 “grab”
-
 “grabbing”
-
 “all-scroll”
-
 “col-resize”
-
 “row-resize”
-
 “n-resize”
-
 “e-resize”
-
 “s-resize”
-
 “w-resize”
-
 “ne-resize”
-
 “nw-resize”
-
 “sw-resize”
-
 “se-resize”
-
 “ew-resize”
-
 “ns-resize”
-
 “nesw-resize”
-
 “nwse-resize”
-
 “zoom-in”
-
 “zoom-out”
#new_from_pixbuf(display, pixbuf, x, y) ⇒ Gdk::Cursor
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.
#new_from_surface(display, surface, x, y) ⇒ Gdk::Cursor
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_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.
On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.
#ref ⇒ Gdk::Cursor
Adds a reference to cursor.
#unref ⇒ nil
Removes a reference from cursor, deallocating the cursor if no references remain.