#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25

    alphabetical order of wxPython List


    I am trying to take a 2d list that on the 1st index of the inner list has a string that contans a name. I want to put each name of that into a listbox, i am using wxPython. So what i am wanting to know is if there is a tool out there that will put the names in the listBox in alphabetical order, if there isn't then how could i go about making a way to do it.
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    I don't know too much about wxPython, but can't you add each item for the listbox into a list, sort the list, and then add each item in that list to the listbox?

    Comments on this post

    • wx_uab agrees : yeah sort method on list
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    I was reading the c++ api for wxWidgets. ListBox has a auto sort premitor right in it. You have to put it in the style part. it is wxLB_SORT. You could also just do the list thing, but this also does the trick.

IMN logo majestic logo threadwatch logo seochat tools logo