필터 지우기
필터 지우기

Multi line edit box, adding text to the top rather than the bottom

조회 수: 1 (최근 30일)
Jason
Jason 2019년 12월 20일
댓글: Jason 2019년 12월 20일
Hello, I have a text box in guide that I use as multi line to keep track of events.
To add a new string to the message box I do below, but it adds to the bottom.
function ReportMessage(handles,msg)
currString=get(handles.editMessage,'String');
currString{end+1}=msg;
set(handles.editMessage,'String',currString);
drawnow;
As the edit boxes dont scroll, I want to change it to add to the top
I tried replacing
currString{end+1}=msg; with currString{1}=msg;
but it overwrites the top line. How do I insert a new line and add the latest mssage to this location, i.e. top of edit box.
Thanks
Jason

채택된 답변

Fangjun Jiang
Fangjun Jiang 2019년 12월 20일
try
currString=[{msg};currString];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by