Re: how to display "busy" cursor ? and another question
- From: Allin Cottrell <cottrell wfu edu>
- To: Han <keepsimple gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: how to display "busy" cursor ? and another question
- Date: Sat, 4 Oct 2008 15:13:45 -0400 (EDT)
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]