IconView and lots of Images GTK
I have question to开发者_如何转开发 GTK users, in my program I will need a lot of images and I wonder if I can somehow connect iconview with images? Because some of these images are going to be big and I want to show ther dwarfs in one window and full size in another. Or do I have to use table and then making small icons from images, place them inside table, save somewhere original dimensions and then just restore original dimensions in that another window where I want to have full dimensions of pictures?
Sorry for bothering and thanks in advance.
You have to first load the image manually (using gdk_pixbuf_new_from_file()
or gdk_pixbuf_new_from_file_at_size()
). Then manually create the different sizes you need (using gdk_pixbuf_scale()
or gdk_pixbuf_scale_simple()
). To add the images to the icon view you have to create a 'GtkListStore' (or any other object implementing the GtkTreeModel interface) and add your scaled down pixbuf to it. It would be a good idea to do this in a separate thread since it will probably take some time for the images to load and you don't want your application to lock up.
精彩评论