Showing specificed images in ThumbnailCtrl, not from a folder but from a list of files

Hi,

I need to show a list of images, select some of them, be able to
right-click and chose items on a popup-meny; the ordinary stuff, all
of which the ThumbnailCtrl-widget gives us just great. But I don't
want to show all images in a given folder, just feed it a list of
files I've collected and then just display those files as thumbnails.

Has anybody done anything like that?

Any hint on how to do this would be highly appreciated.

···

--
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

Hello Thomas,

  sorry for the late reply, holiday time :slight_smile:

I need to show a list of images, select some of them, be able
to right-click and chose items on a popup-meny; the ordinary
stuff, all of which the ThumbnailCtrl-widget gives us just
great. But I don't want to show all images in a given folder,
just feed it a list of files I've collected and then just
display those files as thumbnails.

You should look at the ShowDir and/or ListDirectory methods in ThumbnailCtrl. You can easily modify them to do whatever you want. At the moment, these methods just load all the files from a specified directory, but it's not very hard to change this behaviour:

    def ShowDir(self, dir, filter=THUMB_FILTER_IMAGES):
        """ Shows Thumbnails For A Particular Folder. """
        
        self._dir = dir
        if filter >= 0:
            self._filter = filter
            
        self.SetCaption(self._dir)
        
        self._isrunning = False

        self._parent.RecreateComboBox(dir)
        
        # update items
        self._items =

        # ==> CHANGE HERE <==
        filenames = self.ListDirectory(self._dir, extensions)

        myfiles =
    ...

Andrea.

···

_________________________________________
Andrea Gavana (gavana@kpo.kz)
Reservoir Engineer
KPDL
4, Millbank
SW1P 3JA London

Direct Tel: +44 (0) 20 717 08936
Mobile Tel: +44 (0) 77 487 70534
Fax: +44 (0) 20 717 08900
Web: http://xoomer.virgilio.it/infinity77
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯