[Tutor] Adding items to wxListControl

David Talaga dtalaga at novodynamics.com
Mon Apr 19 12:31:54 EDT 2004

I feel ya.  But hey, if you ever need a program to delete extra carriage
returns I'm the man.  I just spent about a week straight trying to figure
that one out and now I am about where you are.  I need to develop a list box
that saves the files that I "cleaned" into a list box and I am starting all
over... Again...

-----Original Message-----
From: tutor-bounces at python.org [mailto:tutor-bounces at python.org]On
Behalf Of Andy Baker
Sent: Monday, April 19, 2004 12:03 PM
To: tutor at python.org
Subject: [Tutor] Adding items to wxListControl

This is driving me mad!

This is from the examples folder:

        items = musicdata.items()
        for x in range(len(items)):
            key, data = items[x]
            self.list.InsertImageStringItem(x, data[0], self.idx1)
            self.list.SetStringItem(x, 1, data[1])
            self.list.SetStringItem(x, 2, data[2])
            self.list.SetItemData(x, key)

X is a loop counter. What is self.idx1?
What is the last line about! X and the key are the same so what is it doing?

The wxDOcs say:

bool SetItemData(long item, long data)
	Associates application-defined data with this item.

This is about as clear as mud to me! You are passing it two long's. What
does the second long represent?

<whinge> I was getting on really well with Python until I started GUI
programming. For a beginner there seems to be a real lack of clear docs on
both wx and Tk. The general friendliness and quick learning curve of Python
in general don't seem to be there when you move onto GUI programming

Tutor maillist  -  Tutor at python.org

More information about the Tutor mailing list