Getting an image to resize to fit window in a GTK app
I'm trying to write a GUI for use in a robotics project that I'm working on. I'm writing the GUI using GTK (I'm completely new to this). Part of what the GUI needs to be able to do is display images taken from a webcamera mounted on the robot. I've figured out how to get GTK images to display using gtk_image_new_from_file() followed by a widget_show() command. However, this produces an image that is of a constant size (i.e., the image doesn't scale down to fit into a given window size, and it won't scale up to fill up the space allotted to it in it containing widget). How can I get this image to resize to fit into the current space allotted to it (i.e., so that if the user drags on the main window to expand it, the size of the image that I'm displaying will also increase to fill up the newly empty space)? I've checked around on the internet, and it seems that most of the tutorials are for much more advanced users who want to do all kinds of fancy image manipulation that I don't need. Any SIMPLE (or as simple as possible) explanation would be greatly appreciated. Example code snippets would be a HUGE plus :-).