The following is a segment of code that is apparently not working properly. When the program is run, no error messages appear on the console so the image file is being loaded ok, but I don't see the image in the window.
The program is set up such that the image loaded from a pixbuf is inside an event box, which is inside a vbox, which is inside a window.
Is there something wrong with the following code that I am not seeing or any suggestions on what may be happening? Thanks.
Code:
appState->event_box = gtk_event_box_new ();
pixbuf = gdk_pixbuf_new_from_file ("5.jpg", &error );
appState->image = gtk_image_new_from_pixbuf (pixbuf);
gtk_container_add (GTK_CONTAINER (appState->event_box),
appState->image);
gtk_widget_set_size_request ( GTK_WIDGET (appState->event_box),
appState->imageWidth, appState->imageHeight);
gtk_window_resize ( GTK_WINDOW ( appState->window ), appState->imageWidth + 20, appState->imageHeight + 80);
gtk_widget_show (appState->event_box);
[/code]