[wxPython-users] Hello
Al Niessner
Al.Niessner at gmx.net
Tue Oct 2 07:18:24 PDT 2007
Thank you for your help. I have been playing with the lists all day
yesterday and finally started to get something to work (started with
text). Basically I got rid of LC_REPORT and went to LC_LIST, but all of
my icons stack up in the upper left corner and do not react to mouse
events (text works just fine). I will return to LC_REPORT and add some
columns and see if that works better.
Is ImageList really that sensitive to the constructed size image? In my
real application I have icons that are 120x90 as well as 90x120 so I
went with 120x120 just to cover the full range.
I think that I have all of my scoping right. The ImageList that I create
in my application is held by the class that acts as intermediate between
my data, my view, and my controls. The list changes depending on other
events so I am reluctant to give ownership to the list control. In the
sample I sent, the ImageList is created in the global scope and should
not vanish until the program is exited. So in both cases I think the
scoping is good.
On Mon, 2007-10-01 at 12:58 -0700, Robin Dunn wrote:
> 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.
>
>
--
Al Niessner
I have never found the companion that was so companionable as solitude.
- From Walden by Henry David Thoreau
The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.
Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.
- From the song Pepper by the Butthole Surfers
More information about the wxpython-users
mailing list