Hi,
Hi
I try with new changes at my sample code, but not works. Anyone will
have a small example with TextEditMixin. I have the next error:
Traceback (most recent call last):
File "list.py", line 70, in <module>
frame_1 = MyFrame(None, -1, "")
File "list.py", line 31, in __init__
self.OpenEditor(0,0)
File "list.py", line 58, in OpenEditor
listmix.TextEditMixin.OpenEditor(self.lc, col, row)
File "/usr/local/lib/wxPython-unicode-2.8.10.1/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/lib/mixins/listctrl.py",
line 572, in OpenEditor
x0 = self.col_locs[col]
AttributeError: 'TestListCtrl' object has no attribute 'col_locs'
Please read this very carefully, as it will be my last reply to this thread
The OpenEditor method is a callback that is part of the TextEditMixin.
so you need to OVERRIDE this method in your ListCtrl class, not your
frame class.
Ok, now just some general advise, when you get an Exception (as shown
above in your email) try to read it. It usually will tell you exactly
why your code is not working. In this one, the error is saying that
your ListCtrl doesn't have a 'col_locs' attribute. So you should
think, hey I wonder why that is.
Luckily enough if you then look one line up it shows exactly where the
error happened, so why not take a look at that file to see what caused
it, continue upward in the error as necessary.
In this case I would say its a bit of a deficiency in how the
TextEditMixin is implemented, OpenEditor is really only meant to be
called __internally__ by the mixin when you click on a cell in the
list, don't call it directly in your code. If you need to do that you
will need to repeat some of the setup that is done by the mixin's
mouse handler first.
Attached is a modified version of your sample.
list_fixed.py (2.15 KB)
···
On Tue, Nov 24, 2009 at 3:26 PM, Jair Gaxiola <jyr.gaxiola@gmail.com> wrote: