Re: Digital Counter Cursor



> I am looking for a GNOME cursor that would simulate a digital counter
while
> busy. It is analogous to the Microsoft's hour glass cursor. Is there such
a
> cursor available in GNOME?
>

One possible way to do it
is to have a timeout that changes the cursor every X seconds

say

gint num_cursors = 20;
GdkCursor *cursor[num_cursors]; /* Fill this array with cursors */

gint
change_cursor (GdkWindow *window)
{
    static number = 0;

    gdk_window_set_cursor (window, cursor[number]);
    number = (number + 1) % num_cursors;

    return TRUE; /* To keep it going */
}

Then when you need an animated cursor do
timeout_id = gtk_timeout_add (1000, change_cursor, window); /* window is the
GdkWindow of the widget */

and when you need to stop the animation do

gtk_timeout_remove (timeout_id);
gdk_window_set_cursor (window, NULL); /* Same GdkWindow as above */

One note: When I last tried this, the cursor flickered while it was changing
so I thought it looked ugly, but some people liked it.

iain






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]