Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

GUI handle behavior/memory storage

1 visualización (últimos 30 días)
Jared
Jared el 1 de Feb. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I have an issue I can't track down the cause of. I have a GUI listbox, that can display 16 filenames. Directory button 1 displays files 1-8, directory button 2 displays files 9-16. Upon button clicks, I sort the directory and store the the names to be displayed in display_names(1:16)={[]}. After I have all the display names, I
set(handles.listbox,'String',display_names)
The actual order this occurs is: sort directory 1, store names 1-8 in display_names, set(handles...), sort directory 2, store names 9-16, set(handles...). That way, if I change either directory, and overwrite the filebox string, I still have the other directory stored, if that makes sense.
One question, is there a way to access a specific location in the filebox string? Say the fourth line? If I can set 1-8 and 9-16 directly, I wouldn't need the intermediate step of storing in display_names array.
Second, my main issue. I have a reset button, that sets the filebox string to '' and also sets display_names(1:16)={[]}. The filebox becomes blank when I hit this button, as expected. However, say I loaded: directory 1=files 1-8, then directory 2=files 9-16. So they are all displayed, in order, from 1-16 in the list. I hit reset. The list is blank. I then load directory 1=files 9-16. I end up with a full box, even though I only loaded 8 files. I have 9-16, 9-16. Whenever it is reset, and directory 1 is loaded, and is the same as the last directory loaded before reset, I end up with a duplicate list.
I hope that makes sense. It seems to be related to something stored, but I think I am clearing everything.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by