[wxPython-users] Showing specificed images in ThumbnailCtrl, not from a folder but from a list of files

Gavana, Andrea gavana at kpo.kz
Thu Aug 3 05:39:40 PDT 2006


Hello Thomas,

	sorry for the late reply, holiday time :-)

> 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 at 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
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
 




More information about the wxpython-users mailing list