Re: sleeping



Hi,

David Eduardo Gomez Noguera <davidgn servidor unam mx> writes:

> > I'd suggest you use the GTK+ main loop instead and install a timeout.
> > Have a look at gtk_timeout_add().
> 
> what do you mean with the GTK+ main loop? havent done much with gtk, so my knowledge about gtk_main is limited to think that i run it only once.

you start it once and then it's running. You should not sleep since that
would block the main loop. Instead you should hook your functionality
into the main loop.

> I have seen gtk_timeout_add.
> my function needs the two steppers to start and stop moving at the same time, so i use a line algorithm, and would need static variables there.
> Also, i get the command to move the steppers from a GtkEntry widget, then i would need some way to not enable execution of new commands until the lastone ends (was thinking of gtk_object_set_data on the Entry, and a check each time to see if the timer exists.)
> Can i "temporary" block signals from other widgets?

gtk_signal_handler_block()
gtk_signal_handler_block_by_func()
gtk_signal_handler_block_by_data()

gtk_signal_handler_unblock()
gtk_signal_handler_unblock_by_func()
gtk_signal_handler_unblock_by_data()


Salut, Sven





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