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

Re: Change the mouse pointer to sandglass



> I want change to mouse pointer to sandglass to indicate the system is
> busy, how can i do it?

I use functions like this:
void set_wait_cursor(GtkWidget *w)
{
	GtkWidget *parent;
	GdkCursor* cursor;
	
	parent = gtk_widget_get_toplevel(w);
	if (parent != NULL) {
		cursor = gdk_cursor_new(GDK_WATCH);
		gdk_window_set_cursor(parent->window, cursor);
		gdk_cursor_destroy(cursor);
	}
}

void unset_wait_cursor(GtkWidget *w)
{
	GtkWidget *parent;

	parent = gtk_widget_get_toplevel(w);
	if (parent != NULL) {
		gdk_window_set_cursor(gtk_widget_get_toplevel(w)->window, NULL);
	}
}

Now, I can call either one from the event handler of any widget in my
program and pass that to these functions.

-Jim


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