Clear Filters
Clear Filters

How to add items and update listbox cursor in MATLAB GUI?

3 views (last 30 days)
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

Accepted Answer

Walter Roberson
Walter Roberson on 17 Sep 2015
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

More Answers (0)

Categories

Find more on Dialog Boxes in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!