Gdk.Cursor - Classes - Gdk 3.0 (original) (raw)
g GObject.Object GObject.Object Gdk.Cursor Gdk.Cursor GObject.Object->Gdk.Cursor
Subclasses:
None
Methods¶
Inherited:
Structs:
class | new (cursor_type) |
---|---|
class | new_for_display (display, cursor_type) |
class | new_from_name (display, name) |
class | new_from_pixbuf (display, pixbuf, x, y) |
class | new_from_surface (display, surface, x, y) |
get_cursor_type () | |
get_display () | |
get_image () | |
get_surface () | |
ref () | |
unref () |
Virtual Methods¶
Inherited:
Properties¶
Name | Type | Flags | Short Description |
---|---|---|---|
cursor-type | Gdk.CursorType | r/w/co | Standard cursor type |
display | Gdk.Display | r/w/co | Display of this cursor |
Signals¶
Inherited:
Fields¶
Inherited:
Class Details¶
class Gdk.Cursor(**kwargs)¶
Bases:
Abstract:
Yes
A Gdk.Cursor represents a cursor. Its contents are private.
classmethod new(cursor_type)[source]¶
Parameters:
cursor_type (Gdk.CursorType) – cursor to create
Returns:
a new Gdk.Cursor
Return type:
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.CursorType.BLANK_CURSOR.
Deprecated since version 3.16: Use Gdk.Cursor.new_for_display() instead.
classmethod new_for_display(display, cursor_type)[source]¶
Parameters:
- display (Gdk.Display) – the Gdk.Display for which the cursor will be created
- cursor_type (Gdk.CursorType) – cursor to create
Returns:
a new Gdk.Cursor, or None on failure
Return type:
Gdk.Cursor or None
Creates a new cursor from the set of builtin cursors.
New in version 2.2.
classmethod new_from_name(display, name)[source]¶
Parameters:
- display (Gdk.Display) – the Gdk.Display for which the cursor will be created
- name (str) – the name of the cursor
Returns:
a new Gdk.Cursor, or None if there is no cursor with the given name
Return type:
Gdk.Cursor or None
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”
Additionally, the following cursor names are supported, which are not in the CSS specification:
- “dnd-ask”
- “all-resize”
New in version 2.8.
classmethod new_from_pixbuf(display, pixbuf, x, y)[source]¶
Parameters:
- display (Gdk.Display) – the Gdk.Display for which the cursor will be created
- pixbuf (GdkPixbuf.Pixbuf) – the GdkPixbuf.Pixbuf containing the cursor image
- x (int) – the horizontal offset of the “hotspot” of the cursor.
- y (int) – the vertical offset of the “hotspot” of the cursor.
Returns:
a new Gdk.Cursor.
Return type:
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() andGdk.Display.supports_cursor_color() can be used to determine whether RGBA cursors are supported;Gdk.Display.get_default_cursor_size() andGdk.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 in version 2.4.
classmethod new_from_surface(display, surface, x, y)[source]¶
Parameters:
- display (Gdk.Display) – the Gdk.Display for which the cursor will be created
- surface (cairo.Surface) – the cairo image surface containing the cursor pixel data
- x (float) – the horizontal offset of the “hotspot” of the cursor
- y (float) – the vertical offset of the “hotspot” of the cursor
Returns:
a new Gdk.Cursor.
Return type:
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() andGdk.Display.supports_cursor_color() can be used to determine whether RGBA cursors are supported;Gdk.Display.get_default_cursor_size() andGdk.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.
New in version 3.10.
Returns:
Return type:
Returns the cursor type for this cursor.
New in version 2.22.
Returns:
the Gdk.Display associated to self
Return type:
Returns the display on which the Gdk.Cursor is defined.
New in version 2.2.
Returns:
a GdkPixbuf.Pixbuf representingself, or None
Return type:
Returns a GdkPixbuf.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, None is returned.
New in version 2.8.
Returns:
a cairo.Surfacerepresenting self, or None
x_hot:
Location to store the hotspot x position, or None
y_hot:
Location to store the hotspot y position, or None
Return type:
(cairo.Surface or None, x_hot: float, y_hot: float)
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, None is returned.
New in version 3.10.
Returns:
Same self that was passed in
Return type:
Adds a reference to self.
Removes a reference from self, deallocating the cursor if no references remain.
Property Details¶
Gdk.Cursor.props.cursor_type¶
Name:
cursor-type
Type:
Default Value:
Flags:
READABLE, WRITABLE, CONSTRUCT_ONLY
Standard cursor type
Gdk.Cursor.props.display¶
Name:
display
Type:
Default Value:
Flags:
READABLE, WRITABLE, CONSTRUCT_ONLY
Display of this cursor