how do i keep the click order on a uigetfile selection?
18 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hi,
how can i keep the files in the uigetfile in the order in which they were chosen (clicked on)?
thanks a lot!
mat
0 comentarios
Respuestas (1)
Geoff Hayes
el 5 de Oct. de 2014
Mat - I don't think that you can maintain that order using the uigetfile as is. The order in which the files are returned (when using multi-select) is dependent upon the order in which they appear in the dialog. If the files are sorted alphabetically, by size, by modified date, etc., then that is the order in which the selected files are returned.
A similar question was raised at 131684-load-multiple-files-into-gui-in-specific-order and a proposed solution was to use a listbox to manage the list of files to be chosen (assuming all files were to be selected from the same folder).
2 comentarios
Geoff Hayes
el 6 de Oct. de 2014
Hi Mat - the idea is that you have a listbox that contains all files (or rather their names) that you could allow the user to select from. Whenever the user selects (or deselects) a file, the callback to the listbox fires and you would have to consider the new index of the selected (or deselected) file and add it to (or remove it from) a list of the ids that you maintain and is ordered given the user selections. You could have a push button that would then "get the files" in the selected order, which the user would press once all files have been selected.
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!