gtk.gdk.Cursor
gtk.gdk.Cursor — standard and pixmap cursors
Synopsis
class gtk.gdk.Cursor(gobject.GBoxed): |
Description
A gtk.gdk.Cursor
represents a bitmap image used for the mouse pointer. Each gtk.gdk.Window
can
have its own cursor. By default a gtk.gdk.Window
uses
its parent's cursor. A standard set of cursors is provided in
PyGTK
:
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Constructor
gtk.gdk.Cursor(cursor_type
)
| the standard cursor to create |
Returns : | a new gtk.gdk.Cursor |
Creates the new gtk.gdk.Cursor
from
a builtin cursor specified by cursor_type
. To make
the cursor invisible, see the description of the gtk.gdk.Cursor() constructor that
creates a cursor from a pixmap below.
gtk.gdk.Cursor(display
, cursor_type
)
| the gtk.gdk.Display
to create the cursor for |
| the standard cursor to create |
Returns : | a new gtk.gdk.Cursor |
Note
This constructor is available in PyGTK 2.4 and above.
Creates the new gtk.gdk.Cursor
for
the gtk.gdk.Display
specified by display
from a builtin cursor specified
by cursor_type
. To make the cursor invisible, see the
description of the gtk.gdk.Cursor() constructor that
creates a cursor from a pixmap below.
gtk.gdk.Cursor(display
, pixbuf
, x
, y
)
| the gtk.gdk.Display
to create the cursor for |
| the gtk.gdk.Pixbuf
holding the cursor image |
| the "hot spot" x offset |
| the "hot spot" y offset |
Returns : | a new gtk.gdk.Cursor |
Note
This constructor is available in PyGTK 2.4 and above.
Creates a new gtk.gdk.Cursor
for
the gtk.gdk.Display
specified by display using the gtk.gdk.Pixbuf
specified by source
as the icon image. The "hotspot"
of the cursor will be located as the position specified by
x
and y
. To make the cursor
invisible, see the description of the gtk.gdk.Cursor() constructor that
creates a cursor from a pixmap below
gtk.gdk.Cursor(source
, mask
, fg
, bg
, x
, y
)
| the gtk.gdk.Pixmap
holding the cursor image |
| the gtk.gdk.Pixmap to
use as a mask |
| the unallocated foreground gtk.gdk.Color |
| the unallocated background gtk.gdk.Color |
| the "hot spot" x offset |
| the "hot spot" y offset |
Returns : | a new gtk.gdk.Cursor |
Creates a new gtk.gdk.Cursor
using:
- the
gtk.gdk.Pixmap
specified bysource
as the icon image - the
gtk.gdk.Pixmap
specified bymask
to masksource
(must be the same size as source) - the
gtk.gdk.Color
specified byfg
as the foreground color of the cursor - the
gtk.gdk.Color
specified bybg
as the background color of the cursor - the horizontal offset of the cursor "hot spot" specified
by
x
- the vertical offset of the cursor "hot spot" specified
by
y
To make the cursor invisible, create a cursor from an empty
gtk.gdk.Pixmap
as follows:
pixmap = gtk.gdk.Pixmap(None, 1, 1, 1) color = gtk.gdk.Color() cursor = gtk.gdk.Cursor(pixmap, pixmap, color, color, 0, 0)
Methods
gtk.gdk.Cursor.get_display
def get_display()
Returns : | the associated gtk.gdk.Display |
Note
This method is available in PyGTK 2.2 and above.
The get_display
() method returns the
gtk.gdk.Display
on
which the cursor is defined.