Add elements to uilistbox programmatically

Hi everyone. I'm playing with Matlbai GUIs and I've to add elements to a listBox as my program generate them. Actually I've a function that generates data and I want to put the "Name" of those data inside a list box. Here's my function:
function [ birdInfo, trackBuff ] = saveParabolaOnFramesPlot( birdInfo, trackBuff , f, listbox)
Here's how I actually set the element (but it fails saying _ "There is no String property on the ListBox class."_):
set(listbox, 'String', stringOfField)
the variable "stringOfField" is just a string.
Here's how I call this function from AppDesigner Code View:
[app.birdInfo, app.trackBuff ] = saveParabolaOnFramesPlot( app.birdInfo, app.trackBuff , app.birdInfo.aFrame, app.JumpListListBox);
Any helo would be accepted. Thanks. :)

 채택된 답변

Walter Roberson
Walter Roberson 2016년 12월 4일

0 개 추천

You should be using the Items and ItemsData properties.

댓글 수: 2

Leox91
Leox91 2016년 12월 4일
Thanks. Documentation is a bit awful,no examples at all.
Look just above the link I provided at the discussion starting "Programmatic Changes When ItemsData Is Empty". Although it does not provide any code, it makes clearer which properties have to be changed and what the effect is.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Desktop에 대해 자세히 알아보기

질문:

2016년 12월 3일

댓글:

2016년 12월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by