wx.LC_SORT_ASCENDING Not Working

I have a wx.ListCtrl() widget defined as:

   self.lc = wx.ListCtrl(self, wx.ID_ANY, size=wx.Size(175,200),
                         style=wx.LC_REPORT|wx.LC_SORT_ASCENDING)

Yet, when I open a project database and load the entries to the list, they
are not in alphabetical order despite being in column 0.

   According to the wPIA book, it should work. It won't keep the sorted order
(once I get to that point) as new items are added 'cause I'm not using
Windows. That's OK. I do prefer to have them obey the style command,
however.

   What have I missed here?

Rich

···

--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator(TM)
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

Rich Shepard wrote:

  I have a wx.ListCtrl() widget defined as:

  self.lc = wx.ListCtrl(self, wx.ID_ANY, size=wx.Size(175,200),
                        style=wx.LC_REPORT|wx.LC_SORT_ASCENDING)

Yet, when I open a project database and load the entries to the list, they
are not in alphabetical order despite being in column 0.

  According to the wPIA book, it should work. It won't keep the sorted order
(once I get to that point) as new items are added 'cause I'm not using
Windows. That's OK. I do prefer to have them obey the style command,
however.

  What have I missed here?

I don't think that the generic wx.ListCtrl supports the wx.LC_SORT_ styles currently. Just call SortItems with a comparison function after you've loaded the items.

···

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

OK.

Thanks,

Rich

···

On Fri, 9 Feb 2007, Robin Dunn wrote:

I don't think that the generic wx.ListCtrl supports the wx.LC_SORT_ styles currently. Just call SortItems with a comparison function after you've loaded the items.

--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator(TM)
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863