Sorting a PopUpMenu

  1. 4 years ago

    Sascha S

    28 May 2015 Pre-Release Testers, Xojo Pro Germany, Lower Saxonary

    I am using a Xojo PopUpMenu on OS X which i fill with 142 Text (String) Values + RowTags in the Open Event.
    Because i use constants for Multilanguage Support for the Strings, i would like to sort the Rows alphabetically.

    I thought about loading all this into a ListBox, sorting it and then loading it into the PopUpMenu. But i hope there is a "smarter", faster way to do this.

    Has anyone already a solution for this and would you share it with us/me please? :)

    PS: I have searched the Forum and Web without any luck so far...

    Load the values in arrays, use array.SortWith() and populate the menu from the (sorted) arrays.

  2. Carsten B

    28 May 2015 Pre-Release Testers, Xojo Pro Answer Germany, NRW, Europe

    Load the values in arrays, use array.SortWith() and populate the menu from the (sorted) arrays.

  3. Sascha S

    28 May 2015 Pre-Release Testers, Xojo Pro Germany, Lower Saxonary
    Edited 4 years ago

    @Carsten B Load the values in arrays, use array.SortWith() and populate the menu from the (sorted) arrays.

    Ah! Foundit! Thank you :)

    An example: http://docs.xojo.com/index.php/Sortwith

  4. 2 years ago

    Stanley R

    29 Oct 2017 Pre-Release Testers Europe

    I had to do something similar but storing folder item names and data, I found this page, I wrote the code and I decided to write a small page about it: https://www.maxprog.com/site/blog/post.php?id=787 (hope it helps others). I am in the process of creating a small blog with Xojo problems and solutions as I am working on my projects. This is the first page, the index link will at some point redirect to the other Xojo posts :-)

    Stan Busk

or Sign Up to reply!