Can I use threads to change a GTK image?
===

I have a GTK window with an image inside of it. I want this image to change. Let's say I have two images, "sun.png" and "moon.png". Once every second, I want to receieve the output of "date -f%l" to get the current hour. If the hour is between 7-19 (7 AM to 7 PM), I want to display sun.png. Else, I want to display moon.png.

Is it possible to have a seperate thread with a while loop in it, that changes the image as the program's running? How would I go about doing this?

I'm writing in C, by the way.