# Showing pictures in GTK::IconView

**URL:** <https://www.ruby-forum.com/t/showing-pictures-in-gtk-iconview/185963>\
**Category:** Ruby\
**Created:** [March 29, 2010, 8:09pm UTC](https://www.ruby-forum.com/t/showing-pictures-in-gtk-iconview/185963 "2010-03-29T20:09:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas\_Drop](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@Andreas\_Drop](https://www.ruby-forum.com/u/Andreas_Drop)\
**Post date:** [March 29, 2010, 8:09pm UTC](https://www.ruby-forum.com/t/showing-pictures-in-gtk-iconview/185963/1 "2010-03-29T20:09:18Z")

</div>

Hi,

I am working on a program which has to show all the pictures in a  
directory as an icon in a GTK::IconView Widget.

Reading a picture an scaling it down do an iconsize pixbuf takes  
about a second or two. In a directory with lets say 100 pictures  
this is somewhat around 2 minutes, where the user is waiting for the  
program to complete this task.

Now i am working on speeding this up a little bit.

I thought about showing some neutral ‘image’ icon (the same for all  
files) and starting to replace them one after another with the real  
icon after the IconView is initially filled.

Now i see one problem: What is the best way to handle the situation  
that the user chooses another directory while the program still  
works on reading the images. In that case the program should  
immediatly stop filling the iconview, and redo that for the new  
directory.

What are the best practises for this kind of problem

Andy
