[wxPython-users] mixins.listctrl platform differences

Robin Dunn robin at alldunn.com
Fri May 11 14:31:44 PDT 2007


Bob Robison wrote:
> I ran into a problem trying to run one of my linux wxPython apps on
> Windows.  After digging around for a while I tracked the problem to a
> difference in behavior of the ColumnSorterMixin from mixins.listctrl.
> 
> 
> The issue can be easily seen in the ListCtrl.py example shipped with
> wxPython, if you run it on Linux and on Windows (both of these were
> using wxPython 2.8.3).  If the style includes wx.LC_SORT_ASCENDING,
> then the sorting is done immediately on insertion on windows, but not
> on Linux.

Yes this is a known limitation of the generic listctrl.  The native one 
on Windows takes care of that for us when the style flag is turned on.

> 
> For me, I didn't really want any sorting taking place until someone
> clicked a column header -- which I guess means I probably don't want
> the LC_SORT_ASCENDING style put in on the constructor. 

Correct.

> I was just
> copying it from the example.  If the only sorting I need is upon
> column clicking, then I don't really need to specify that style.
> Which probably means that it is working correctly on Windows, but not
> on Linux?

It depends on what you mean by "working correctly"  ;-)


> 
> If you do set that flag, I guess the sorting is just going to occur
> on the first column?

Yes.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list