Sorting A ComboBox

The current thread on sorting a ListBox reminded me to ask why the style,
wx.CB_SORT might not be working for me. Here's the definition of a widget:

   self.vcomp = wx.ComboBox(self, wx.ID_ANY, size=wx.Size(150, 25),
                              style=wx.CB_DROPDOWN|wx.CB_SORT|
                              wx.TAB_TRAVERSAL|wx.RAISED_BORDER)

yet, when values are loaded into the dropdown list, they're not sorted
alphabetically. I assume it's a step that I've missed and a nudge in the
right direction will help.

Rich

···

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

Rich Shepard wrote:

  The current thread on sorting a ListBox reminded me to ask why the style,
wx.CB_SORT might not be working for me. Here's the definition of a widget:

    self.vcomp = wx.ComboBox(self, wx.ID_ANY, size=wx.Size(150, 25),
                             style=wx.CB_DROPDOWN|wx.CB_SORT|
                             wx.TAB_TRAVERSAL|wx.RAISED_BORDER)

yet, when values are loaded into the dropdown list, they're not sorted
alphabetically. I assume it's a step that I've missed and a nudge in the
right direction will help.

Please enter a bug report about this with a category of "wxGTK Specific"

···

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

Done.

···

On Tue, 2 Oct 2007, Robin Dunn wrote:

Please enter a bug report about this with a category of "wxGTK Specific"

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

In the mean time, you can always sort the list manually before putting it
in the wx.ComboBox.

someList.sort() does the trick.

Mike

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Tuesday, October 02, 2007 2:42 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Sorting A ComboBox

Rich Shepard wrote:
> The current thread on sorting a ListBox reminded me to
ask why the
> style, wx.CB_SORT might not be working for me. Here's the
definition of a widget:
>
> self.vcomp = wx.ComboBox(self, wx.ID_ANY, size=wx.Size(150, 25),
> style=wx.CB_DROPDOWN|wx.CB_SORT|
> wx.TAB_TRAVERSAL|wx.RAISED_BORDER)
>
> yet, when values are loaded into the dropdown list, they're
not sorted
> alphabetically. I assume it's a step that I've missed and a
nudge in
> the right direction will help.

Please enter a bug report about this with a category of
"wxGTK Specific"

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

Mike,

   Good recommendation. Thank you.

Rich

···

On Wed, 3 Oct 2007, Mike Driscoll wrote:

In the mean time, you can always sort the list manually before putting it
in the wx.ComboBox.

someList.sort() does the trick.

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