![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
Is there a sorted feature built into the wxListBox, or does it have to be done externally? Can't find anything in the poorly written manual.
__________________
I looked it up on the Intergnats! |
|
|
|
|
|
#2 |
|
Banned
![]() ![]() |
I don't know wxpython, but you could try going
dir(wxListBox) and see if you see anything along the lines of 'sort' or you could try help(wxListBox) or help(wxPython) That's all I can help. ![]()
__________________
Looking for tough programming challenges? Try participating in Sane's Monthly Algorithms Challenges! Composing Techno is a little side hobby of mine. Techno by DJ Sane. All free for download. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jul 2005
Location: Philadelphia, PA
Posts: 11
Rep Power: 0
![]() |
I did it like this,
self.commandList = {'Channel Up': 'c+', 'Channel Down': 'c-', 'Vol Up': 'v+', 'Vol Down': 'v-', 'Guide': 'g', 'Settings': 's',
'Select': 'sel', 'Page Up': 'p+', 'Page Down': 'p-', 'Mute': 'm', 'A Key': 'A', 'B Key': 'B', 'C Key': 'C',
'Up Arrow': 'u', 'Down Arrow': 'd', 'Left Arrow': 'l', 'Right Arrow': 'r', 'Info': 'i', 'Exit': 'e','Launch Diags': 'launch', 'Channel #': '#'}
self.choices = self.commandList.keys()
self.choices.sort()
self.listbox = wx.ListBox(self, -1, (120, 50), (90, 120), self.choices, wx.LB_SINGLE)
self.Bind(wx.EVT_LISTBOX, self.EvtListBox, self.listbox)Basically sort the list before you put it in the ListBox. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|