Method to sort ListIconGadget

Just starting out? Need help? Post your questions and find answers here.
superjacent
User
User
Posts: 27
Joined: Mon Oct 01, 2007 1:38 pm
Location: Melbourne, Australia
Contact:

Method to sort ListIconGadget

Post by superjacent »

Ok, I'm populating a ListIconGadget with a list of files from a directory. The intention being to batch rename the files. An obvious option is to sort the files by name or date etc. prior to passing the files through a rename procedure.

It's the sorting bit that I'm stumbling on. What are my options here? Do I have to use a corresponding array, sort that array and pass the data back to the ListIconGadget.

Any help appreciated.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

ListIcons (WIndows only) can be told to sort the items based upon a callback procedure which you provide. It is quite simple and there's plenty of code in the forums to help out (make sure it's PB 4 compatible in this case though!)

Alternatively, have a look at Gnozal's PureLVSort library.
I may look like a mule, but I'm not a complete ass.
Post Reply