フィルターのクリア

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

1 回表示 (過去 30 日間)
John
John 2015 年 9 月 17 日
コメント済み: John 2015 年 9 月 17 日
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

採用された回答

Walter Roberson
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
  1 件のコメント
John
John 2015 年 9 月 17 日
thank you Walter, the issue has been solved:)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDialog Boxes についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by