MATLAB Answers

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

1 view (last 30 days)
Jason
Jason on 20 Dec 2019
Commented: Jason on 20 Dec 2019
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

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags