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
What are the best practises for this kind of problem