Re: implementing a delayed "busy" cursor



On Sun, 2007-08-05 at 11:20 -0400, Paul Fox wrote:
> hi --
> 
> i want the mouse cursor in my app to only switch to "busy" after
> a brief delay (perhaps 1 second).  i have an implementation that
> works in some places, but not others, and i'm wondering if
> there's a better/safer way.

>        if (newcursor == CURSOR_BUSY_WITH_DELAY) {
>           signal(SIGALRM, busy_cursor_handler);
>           alarm(1);

this is unsafe coding. POSIX signal handlers should do almost nothing,
and they should certainly not call GTK functions.

investigate the use of timeouts within GTK itself, which are *much*
better suited for this purpose.

--p





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