Changing widgets in events



Does anyone know a way to change widgets while running an event
handler?  For example, I created a window with a single button on it.  I
used gtk_signal_connect to connect a function to the button to fire when
it is pressed.  Inside the function, I just sleep for 20 seconds. 
Before I issue the sleep call, I change the cursor to a "watch" cursor. 
When the sleep is finished, I change it back to the default arrow.  When
I run this program, pressing the button makes it stop for 20 seconds,
but the cursor does not change.  If I remove the call to change the
cursor back to the arrow, the cursor changes to the watch, but only
after the 20 seconds is over (which I assume is after the event has
finished).  I have tried different combinations of changing cursors,
pulsing progress bars, etc.  I have also tried doing something time
consuming other than just sleeping (like computing the fib of 30, for
example).  I have looked over the documentation for signal handlers,
using both the deprecated gtk_signal* and the new g_signal*, neither of
them discuss this.  Am I doing something wrong?  I am using gtk 2.2, and
have tested this with the same results in Solaris 9 and Linux 2.4.

Thanks in advance.

brian.




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