How to add items and update listbox cursor in MATLAB GUI?
2 次查看(过去 30 天)
显示 更早的评论
Hey guys,
i am working on a kind of logbox, which shall document every step the user does in the GUI. Therefore i want to display text comments in a listbox in the front surface of the GUI.
Attached you find a basic example. The Main GUI is logboxtest.m. From this GUI i can initialize the listbox by pressing the push button. This works fine and the cursor is even updated to the last element, that is added! so this is actually the result i would like to achieve for the other option too;
The other option is, to press the OpenSubGUI-button and open the File named push.m. From this Subgui i want to add text to the listbox in the MainGUI by pressing the push-button there. Adding of the text works fine! but the cursor cannot update to the last element and it occurs the error message
Error using set
Conversion to double from cell is not possible.
Error in push>pushbutton1_Callback (line 93)
set(handlesGui_logboxtest.names,'ListboxTop',num_element) %set Listbox to last element
Could you please help me? This is a basic example...i aim at transfering data from many subGUIs to the main GUIs logbox, so that the user is always aware of his previous actions but unfortunately i cannot run this one.
I am very glad for your help!!
Best regards, John
0 个评论
采纳的回答
Walter Roberson
2015-9-17
Change
set(handlesGui_logboxtest.names,'ListboxTop',num_element) %Setze Listbox auf letztes Element
to
set(handlesGui_logboxtest.listbox1,'ListboxTop',num_element) %Setze Listbox auf letztes Element
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dialog Boxes 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!