Re: how to display "busy" cursor ? and another question



On Sat, 4 Oct 2008, Han wrote:

I have a couple of questions when learning to program GTK+ :

1) How can I display a "busy" cursor to users ?  The reason is that I
need to perform a task and cannot response to users for a few seconds.

Something like this, maybe:

void busy_stuff ()
{
    GdkDisplay *display;
    GdkCursor *cursor;
    GdkWindow *window;
    gint x, y;

    cursor = gdk_cursor_new(GDK_WATCH);

    display = gdk_display_get_default();
    window = gdk_display_get_window_at_pointer(disp, &x, &y);

    gdk_window_set_cursor(window, cursor);
    gdk_display_sync(display);
    gdk_cursor_unref(cursor);

    /* do time-consuming stuff here */

    gdk_window_set_cursor(window, NULL);
}

(Sorry, I pass on question 2.)

Allin Cottrell



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