[wxPython] RE: ListCtrl Column Clicking Major Problem.

Hi again. I've been trying to get the column sorting thing working with a
ListCtrl.
I've basically set up my app (a contact manager) to work similarly to the
ListCtrl in the demo, BUT, instead of using numbers as keys to access the
dictionary items, I'm using names (it's an address book afterall). I'm also
keeping a separate namelist for sorting and display purposes.

So far, I am *totally* unable to figure a way around needing to use numbers
as keys in order to get the column clicking feature to work properly. This
means that I am going to have to do a massive revision of the entire program
to have this feature.

What I want to do is quite simple: have the names sorted alphabetically upon
opening (column 0), and have the option of sorting by email, etc. via column
clicking.

···

--- On 28 Feb you wrote: ---
-----------------------------

I keep running into things Listctrl won't do, too. For an app like this I
would try a grid. Since it's not a control, it doesn't propagate events in
the same way, but I haven't found that too big a problem.

Rob Dickinson

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Thanks for the suggestions. I ended up using a list containing sublists of number/name pairs to map
names to numbers, and then a dictionary to map the numbers to information. This solved the problem
of not being able to have duplicate names in the list (if I had used names as dictionary keys,
this would not have been possible. )

HOWEVER, now I've been loading the ListCtrl with the names in alphabetical order as the first column,
and then setting item data to the corresponding i.d. number. and column clicking results in some really odd
behavior!! Looking again at the demo, I notice two things:

1. The dataitems (dict keys) are all in order from least to greatest when set. In my ListCtrl, they are all mixed up.
2. In the demo, the index(x) equates to the key number. In my app, this is not the case at all.

the only other difference is that I'm using 4 columns instead of 3, but this shouldn't make a difference.

help! *L*

···

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users