Want to force update of GtkImage widget



Hi all, my first post here. Bear with me, I'm also new to Gtk...

Rather than posting alot of code I'll try to describe my problem on a more conceptual level and would like to hear if what I'm trying to do and how I go about it seems sound.

I have an industrial camera from which I can manage to grab and save to disk as many pictures as I like. I do this in a loop which resides in a callback function which is called when the take pictures button is clicked. Number of pictures to take is specified by the user in a GtkTextEntry. So far so good. What I also want is that a GtkImage-widget should be updated to immediately display each new picture. This doesn't happen. Only the last picture taken will be displayed and this happens exactly when the "take pictures"-button callback returns. I guess the gtk-main loop has my request for widget update [gtk_image_set_from_pixbuf(snapshot, pixbuf)] queued and will do my request after it's done with the callback. I've tried some functions like gtk_widget_show_now and gtk_widget_queue_draw right after the call to gtk_image_set_from_pixbuf(snapshot, pixbuf), to no avail, obviously.

Any suggestions would be so welcome!


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