Re: async headaches



muppet wrote:

had a devil of a time solving a race condition problem.  i'd like your
opinions on what might be a better way to solve this one.

---

i'm creating a file open dialog specifically for images, which shows
some image properties and a thumbnail for each image the user selects in
the file list.  i'm using imagemagick's convert and some home-grown
image loading display code for various reasons that aren't all that
relevant.

to the "select-row" signal of the file CList i bound a callback which
would attempt to load and preview the image.  so far so good.  each time
it runs, it forks a call to convert (via piped open), so there is no
caching of thumbnails (though given time i would like to cache them, but
the regeneration logic is more than i want to deal with right now).
Hi, I haven't tried any of this but...

could you connect to the button_press_event? Then you could check for

 if ($event->{'type'} eq "2button_press") {

and only preview in other cases - or after the double-click is handled.

Regards, Dermot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]