Message window in GUI (MatLab)
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Naz
am 13 Okt. 2011
Kommentiert: Walter Roberson
am 9 Aug. 2020
Hello. I am trying to create a text window in GUI that will be used to display messages/current activity of the program. It should be similar to the Command Window of matlab. That is, when I want to output some message, the message should appear in my text window of the GUI, not in the Command Window. Also, the text window will be used only for output, so no input will be preformed. I use the 'edittext' component as follows:
set(handles.edit1,'String','My message' );
however, next time when I want to output a new message, I want the old message to be present in the message box as well. That is, my message box should accumulate all the messages over time (or at least several most recent strings) just like Command Window or any console window does.
Thank you
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 13 Okt. 2011
oldmsgs = cellstr(get(handles.edit1,'String'));
set(handles.edit1,'String',[oldmsgs;{'My message'}] );
And be sure to set the edit box to 'Enable', 'disable'.
I thought I wrote about this topic just about a week ago, but I cannot seem to find that message.
Automatically position the scroll bar to any particular position in the edit list box requires resorting to the Java level.
6 Kommentare
Nguyen Thuan
am 9 Aug. 2020
Hi Victor! I have add this command in GUI of app designer:
set(handles.edit1,'String',[{'My message'};oldmsgs] );
However, there is an error appearing: "Undefined variable "handles..."
Could you please tell me how to use this command in GUI?
Thanks a lot!
Walter Roberson
am 9 Aug. 2020
app.APPROPRIATE_NAME_GOES_HERE.Value = [{'My message'};oldmsgs];
where APPROPRIATE_NAME_GOES_HERE is the name you gave to the text area.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Code Execution finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!