[wxPython-users] Hello

Robin Dunn robin at alldunn.com
Mon Oct 1 12:58:16 PDT 2007


Al Niessner wrote:
> I am having difficulties displaying a list of images (thumbnails) and
> then interacting with them. I have attached the program I am using along
> with the thumbnail.
> 
> I have googled this problem every way that I can think of and have not
> found a solution yet. I do not think that I am ending up with a dangling
> reference as suggested in previous threads because all of the
> information is allocated in the "main".
> 
> I generated the program with wxglade. I did this because I have much
> larger application already using lists and trees and image windows and
> all kinds of GUI stuff generated with wxglade.
> 
> I then added my custom stuff to run as long as it is the "main". Nothing
> exciting in any of it. I did try making a ListItem and setting the Image
> and then dropping that into the list control as well, but then I just
> get text.
> 
> So, I am all out of ideas and googling so I thought I would try this
> list. Any and all help is very much appreciated.

You either need to save a reference to the image list, or use 
AssignImageList instead of SetImageList so the ListCtrl will take 
ownership of it.  Otherwise the image list will be destroyed when it 
goes out of scope.

You also need to specify the right size in the image list constructor 
(120,90, not 120,120)

You've specified the wx.LC_REPORT style for the listctrl, but you've not 
added any columns.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list