public final class Cursor extends Boxed
A Cursor object must be bound to a underlying Window before [changing it]
will actually cause what the user sees to change; see
setCursor()
on the Window here in
org.gnome.gdk
.
Quite frequently you want to change the Cursor for the entire application (in a manner reminiscent of modal behaviour). This is trickier than it should be, but you've got a couple possibilities. You can either
[org.gnome.gtk]
Windows being displayed by your application and then call
getWindow().setCursor(BLAH)
on each of them, or you can
getToplevels()
on
[org.gnome.gdk]
Window and then similarly just call
setCursor(BLAH)
as you iterate over the returned set.
Almost inevitably the Cursor your want is BUSY
which is
the spinning "busy" pointer. You can revert to "normal" by setting
NORMAL
directly (which is the default cursor you
spend most of your time looking at), or by passing null
to
setCursor()
.
Note that different theme engines (let alone different Linux vendors) tend to screw with the default pointer icons set quite a bit, so you may find that pointers appear very different for users on different distributions.
Our implementation of Cursor assumes you want to manipulate
GdkCursors
on the "default" GdkDisplay
. Where
else would you be working?
Modifier and Type | Field and Description |
---|---|
static Cursor |
BUSY
The spinning cursor showing that the application is busy (and unable to
be responsive to user input).
|
static Cursor |
LINK
A pointer indicating that a hyperlink can be clicked and followed.
|
static Cursor |
NORMAL
The normal left-hand pointer.
|
static Cursor |
TEXT
The vertical bar pointer used in text entry Widgets such as Entry and
TextView.
|
static Cursor |
WORKING
A pointer that also has a busy spinner.
|
Constructor and Description |
---|
Cursor(CursorType type)
Create a new Cursor with the specified CursorType.
|
public static final Cursor BUSY
This is type WATCH
.
public static final Cursor LINK
This is type HAND2
.
public static final Cursor NORMAL
This is a type LEFT_PTR
.
public static final Cursor TEXT
This is type XTERM
.
public static final Cursor WORKING
This is "left_ptr_watch"
from the cursor theme.
public Cursor(CursorType type)