Should gtk_widget_draw be un-depreicated?



Presently the function gtk_widget_draw is deprecated in favor of gtk_widget_queue_draw. I need the great minds of gtk to think of a way I've missed to accomplish a certain task, or consider un-deprecating gtk_widget_draw.

The context is a multi threaded application using gtk. In a thread that is not the main application thread that called gtk_init, a process waits to get the lock calling gtk_threads_enter. Then in a fairly tight loop at high thread priority it calls gtk_image_set_from_pixbuf to display an image, calls gtk_widget_draw, then starts a timer, waits for a process not related to the computer to send a response to the computer in reaction to the image, records a time for the reaction, then repeats the loop using different images. Timing is important and the images can change more than a few times per second.

I've tried all sorts of non-deprecated combinations of gtk_widget_queue_draw, gtk_window_flush, gdk_flush, while(gtk_events_pending()) gtk_main_iteration(), etc. Doesn't work. The only answer I can think of to retain the ability to time most accurately, starting the moment that the image has been drawn is to use gtk_widget_draw right after setting the pixbuf. If there is a non-deprecated way to start a timer as soon as an image is known to be drawn without using gtk_widget_draw I'd need to be educated about it. If not I think there is a good argument to not deprecate gtk_widget_draw.

Thanks one and all

Harry Coin






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