# Gdk::Cursor Class Reference

This represents a cursor. More...

Inheritance diagram for Gdk::Cursor:
[legend]
Collaboration diagram for Gdk::Cursor:
[legend]

List of all members.

## Public Member Functions

virtual | ~Cursor ()
GdkCursor* | gobj ()
| Provides access to the underlying C GObject.
const GdkCursor* | gobj () const
| Provides access to the underlying C GObject.
GdkCursor* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::RefPtr< Display > | get_display ()
| Returns the display on which the Gdk::Cursor is defined.
Glib::RefPtr< const Display > | get_display () const
| Returns the display on which the Gdk::Cursor is defined.
Glib::RefPtr< Gdk::Pixbuf > | get_image ()
| Returns a Gdk::Pixbuf with the image used to display the cursor.
Glib::RefPtr< const Gdk::Pixbuf > | get_image () const
| Returns a Gdk::Pixbuf with the image used to display the cursor.
CursorType | get_cursor_type () const

## Static Public Member Functions

static Glib::RefPtr< Cursor > | create (CursorType cursor_type)
| Creates a new cursor from the set of builtin cursors for the default display.
static Glib::RefPtr< Cursor > | create (const Glib::RefPtr< Display >& display, CursorType cursor_type)
| Creates a new cursor from the set of builtin cursors.
static Glib::RefPtr< Cursor > | create (const Glib::RefPtr< Display >& display, const Glib::RefPtr< Pixbuf >& pixbuf, int x, int y)
| Creates a new cursor from a pixbuf.
static Glib::RefPtr< Cursor > | create (const Glib::RefPtr< Display >& display, const Glib::ustring& name)
| Creates a new cursor by looking up name in the current cursor theme.

## Protected Member Functions

| Cursor (const Glib::RefPtr< Display >& display, const Glib::ustring& name)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gdk::Cursor > | wrap (GdkCursor* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

This represents a cursor.

## Constructor & Destructor Documentation

virtual Gdk::Cursor::~Cursor | ( |  | ) | `[virtual]`

Gdk::Cursor::Cursor | ( | const Glib::RefPtr< Display >& | display,
|  | const Glib::ustring & | name
| ) |  | `[explicit, protected]`

## Member Function Documentation

static Glib::RefPtr<Cursor> Gdk::Cursor::create | ( | CursorType | cursor_type | ) | `[static]`

Creates a new cursor from the set of builtin cursors for the default display.

See new_for_display().

To make the cursor invisible, use Gdk::BLANK_CURSOR.

Parameters:

  cursor_type | Cursor to create.

Returns:
  A new Gdk::Cursor.

static Glib::RefPtr<Cursor> Gdk::Cursor::create | ( | const Glib::RefPtr< Display >& | display,
|  | CursorType | cursor_type
| ) |  | `[static]`

Creates a new cursor from the set of builtin cursors.

Some useful ones are: <itemizedlist> <listitem> <inlinegraphic format="PNG" fileref="right_ptr.png"></inlinegraphic> Gdk::RIGHT_PTR (right-facing arrow) </listitem> <listitem> <inlinegraphic format="PNG" fileref="crosshair.png"></inlinegraphic> Gdk::CROSSHAIR (crosshair) </listitem> <listitem> <inlinegraphic format="PNG" fileref="xterm.png"></inlinegraphic> Gdk::XTERM (I-beam) </listitem> <listitem> <inlinegraphic format="PNG" fileref="watch.png"></inlinegraphic> Gdk::WATCH (busy) </listitem> <listitem> <inlinegraphic format="PNG" fileref="fleur.png"></inlinegraphic> Gdk::FLEUR (for moving objects) </listitem> <listitem> <inlinegraphic format="PNG" fileref="hand1.png"></inlinegraphic> Gdk::HAND1 (a right-pointing hand) </listitem> <listitem> <inlinegraphic format="PNG" fileref="hand2.png"></inlinegraphic> Gdk::HAND2 (a left-pointing hand) </listitem> <listitem> <inlinegraphic format="PNG" fileref="left_side.png"></inlinegraphic> Gdk::LEFT_SIDE (resize left side) </listitem> <listitem> <inlinegraphic format="PNG" fileref="right_side.png"></inlinegraphic> Gdk::RIGHT_SIDE (resize right side) </listitem> <listitem> <inlinegraphic format="PNG" fileref="top_left_corner.png"></inlinegraphic> Gdk::TOP_LEFT_CORNER (resize northwest corner) </listitem> <listitem> <inlinegraphic format="PNG" fileref="top_right_corner.png"></inlinegraphic> Gdk::TOP_RIGHT_CORNER (resize northeast corner) </listitem> <listitem> <inlinegraphic format="PNG" fileref="bottom_left_corner.png"></inlinegraphic> Gdk::BOTTOM_LEFT_CORNER (resize southwest corner) </listitem> <listitem> <inlinegraphic format="PNG" fileref="bottom_right_corner.png"></inlinegraphic> Gdk::BOTTOM_RIGHT_CORNER (resize southeast corner) </listitem> <listitem> <inlinegraphic format="PNG" fileref="top_side.png"></inlinegraphic> Gdk::TOP_SIDE (resize top side) </listitem> <listitem> <inlinegraphic format="PNG" fileref="bottom_side.png"></inlinegraphic> Gdk::BOTTOM_SIDE (resize bottom side) </listitem> <listitem> <inlinegraphic format="PNG" fileref="sb_h_double_arrow.png"></inlinegraphic> Gdk::SB_H_DOUBLE_ARROW (move vertical splitter) </listitem> <listitem> <inlinegraphic format="PNG" fileref="sb_v_double_arrow.png"></inlinegraphic> Gdk::SB_V_DOUBLE_ARROW (move horizontal splitter) </listitem> <listitem> Gdk::BLANK_CURSOR (Blank cursor). Since 2.16 </listitem> </itemizedlist>

Since gtkmm 2.2:

Parameters:

  display | The Gdk::Display for which the cursor will be created.
  cursor_type | Cursor to create.

Returns:
  A new Gdk::Cursor.

static Glib::RefPtr<Cursor> Gdk::Cursor::create | ( | const Glib::RefPtr< Display >& | display,
|  | const Glib::RefPtr< Pixbuf >& | pixbuf,
|  | int | x,
|  | int | y
| ) |  | `[static]`

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.

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

Since gtkmm 2.4:

Parameters:

  display | The Gdk::Display for which the cursor will be created.
  pixbuf | The Gdk::Pixbuf containing the cursor image.
  x | The horizontal offset of the 'hotspot' of the cursor.
  y | The vertical offset of the 'hotspot' of the cursor.

Returns:
  A new Gdk::Cursor.

static Glib::RefPtr<Cursor> Gdk::Cursor::create | ( | const Glib::RefPtr< Display >& | display,
|  | const Glib::ustring & | name
| ) |  | `[static]`

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

Since gtkmm 2.8:

Parameters:

  display | The Gdk::Display for which the cursor will be created.
  name | The name of the cursor.

Returns:
  A new Gdk::Cursor, or `0` if there is no cursor with the given name.

CursorType Gdk::Cursor::get_cursor_type | ( |  | ) | const

Glib::RefPtr<Display> Gdk::Cursor::get_display | ( |  | ) |

Returns the display on which the Gdk::Cursor is defined.

Since gtkmm 2.2:

Returns:
  The Gdk::Display associated to cursor.

Glib::RefPtr<const Display> Gdk::Cursor::get_display | ( |  | ) | const

Returns the display on which the Gdk::Cursor is defined.

Since gtkmm 2.2:

Returns:
  The Gdk::Display associated to cursor.

Glib::RefPtr<Gdk::Pixbuf> Gdk::Cursor::get_image | ( |  | ) |

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, `0` is returned.

Since gtkmm 2.8:

Returns:
  A Gdk::Pixbuf representing cursor, or `0`.

Glib::RefPtr<const Gdk::Pixbuf> Gdk::Cursor::get_image | ( |  | ) | const

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, `0` is returned.

Since gtkmm 2.8:

Returns:
  A Gdk::Pixbuf representing cursor, or `0`.

const GdkCursor* Gdk::Cursor::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GdkCursor* Gdk::Cursor::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GdkCursor* Gdk::Cursor::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

## Friends And Related Function Documentation

Glib::RefPtr< Gdk::Cursor > wrap | ( | GdkCursor * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gdkmm/cursor.h