我是林间空地的新手。我想从文件夹中显示图像文件夹。我写了一个c程序,但还不足以到达目的地。
#include <gtk/gtk.h>
void
on_window_destroy (GtkObject *object, gpointer user_data)
{
gtk_main_quit ();
}
int
main (int argc, char *argv[])
{
GtkBuilder *builder;
GtkWidget *window;
gtk_init (&argc, &argv);
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, "image.xml", NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
gtk_builder_connect_signals (builder, NULL);
g_object_unref (G_OBJECT (builder));
gtk_widget_show (window);
GError *error = NULL;
GdkPixbuf *pix = gdk_pixbuf_new_from_file ("logo1.png", &error);
gtk_widget_imageshow(pix) ;
}
是否可以刷新图像?谢谢