Gdk.Cursor¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
Standard cursor type |
||
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
) – theGdk.Display
for which the cursor will be createdcursor_type (
Gdk.CursorType
) – cursor to create
- Returns:
a new
Gdk.Cursor
, orNone
on failure- Return type:
Gdk.Cursor
orNone
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
) – theGdk.Display
for which the cursor will be createdname (
str
) – the name of the cursor
- Returns:
a new
Gdk.Cursor
, orNone
if there is no cursor with the given name- Return type:
Gdk.Cursor
orNone
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 in version 2.8.
- classmethod new_from_pixbuf(display, pixbuf, x, y)[source]¶
- Parameters:
display (
Gdk.Display
) – theGdk.Display
for which the cursor will be createdpixbuf (
GdkPixbuf.Pixbuf
) – theGdkPixbuf.Pixbuf
containing the cursor imagex (
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 between0
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
) – theGdk.Display
for which the cursor will be createdsurface (
cairo.Surface
) – the cairo image surface containing the cursor pixel datax (
float
) – the horizontal offset of the “hotspot” of the cursory (
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.
- get_cursor_type()[source]¶
- Returns:
- Return type:
Returns the cursor type for this cursor.
New in version 2.22.
- get_display()[source]¶
- Returns:
the
Gdk.Display
associated to self- Return type:
Returns the display on which the
Gdk.Cursor
is defined.New in version 2.2.
- get_image()[source]¶
- Returns:
a
GdkPixbuf.Pixbuf
representing self, orNone
- 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.
- get_surface()[source]¶
- Returns:
a
cairo.Surface
representing self, orNone
- Return type:
(
cairo.Surface
orNone
, 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.
- ref()[source]¶
- Returns:
Same self that was passed in
- Return type:
Adds a reference to self.
Deprecated since version 3.0: Use
GObject.Object.ref
() instead
- unref()[source]¶
Removes a reference from self, deallocating the cursor if no references remain.
Deprecated since version 3.0: Use
GObject.Object.unref
() instead
Property Details¶
- Gdk.Cursor.props.cursor_type¶
- Name:
cursor-type
- Type:
- Default Value:
- Flags:
Standard cursor type
- Gdk.Cursor.props.display¶
- Name:
display
- Type:
- Default Value:
- Flags:
Display of this cursor