Steven Sproat wrote:
I'd assume that run and images are Python modules inside the demo folder, for they are far too generally named to be a system-wide important (e.g. compared to numpy, wx, psyco)
That's not what I assumed, and even in hindsight, I don't think it's a fair assumption. If you can "import math" why not "import images"? It seems reasonable enough that Python might come with an images module. Ditto for "run". Whatever it does, it sounds like something that could be part of Python itself.
EVEN IF I figure that "images" is a local module, you just added a 7,000 line module with a bunch of gibberish and decided to use it in a demo that's supposed to show me how lists work.
There's only about 200 lines of *code*. The point of the demos is that they demonstrate most of the functionality offered by a class
I think that ListCtrl is needlessly complex, EVEN IF we agree that we want to show a lot of the the features of the class.
Why do I need ListCtrlAutoWidthMixin? Why do I need a separate class for TestListCtrl and TestListCtrlPanel? What does all the code inside the platform-specific __WXMAC__ do? Why is it there?
The way the program is laid out, it is harder to figure out how to insert text than how to insert an image with your custom module. (And I'd question whether teaching me how to use your custom images module is valuable).
Look, it doesn't make sense to argue about whether the demo is easy or hard to understand. I have been studying wx for a week or two now and I couldn't figure it out. That should be evidence that it is hard. Maybe you are an expert and already know all this stuff, but if that's the case, you should listen to the newbie (who was a teacher for 8 years) who says that it's hard.
- if they didn't, then you'd be wondering questions like "how do I do x, how do I do y" and have stop reading the demo code and look elsewhere. With the code in the demo, it's all in one convenient place
Not very convenient as my experience shows. At least you could add some code comments, simplify the code, separate the features and put them in a logical order (basic features first). For example, a place to start would be:
1) FIRST create an empty list.
2) THEN add some text.
3) THEN add coloured text.
4) THEN add an image.
I should not have to parse through image-creating code before I even know how to insert text.
IF you are going to insert images, then just insert the image. Why do you need things like:
self.idx1 = self.il.Add(images.Smiles.GetBitmap())
self.sm_up = self.il.Add(images.SmallUpArrow.GetBitmap())
self.sm_dn = self.il.Add(images.SmallDnArrow.GetBitmap())
# Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py
def GetSortImages(self):
return (self.sm_dn, self.sm_up)
This is mostly gibberish to me and it doesn't teach me how to use ListCtrl.
Daniel.