Info

この質問は閉じられています。 編集または回答するには再度開いてください。

GUI handle behavior/memory storage

1 回表示 (過去 30 日間)
Jared
Jared 2013 年 2 月 1 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by