Creating a terminal similar to Matlab terminal in a GUI

1 次查看(过去 30 天)
Hi,
I want to create a terminal window much like the Matlab command window which will periodically display messages and I am able to scroll through them freely.
Right now I've kind of accomplished that by using listbox.
function main()
this.gui_h = guidata(messages);
for i = 1:500
pause(0.5);
outputString = sprintf('I am %d years old', i);
oldmsgs = cellstr(get(this.gui_h.window_disp,'String'));
set(this.gui_h.window_disp, 'String',[oldmsgs; {outputString}] );
end
end
One slight problem is that since the string always updates it stuffs up the scrollbar and is not very userfriendly. I have trouble freely scrolling through past messages as it constantly updates to the latest messages.
Any fix? I've attached my gui figure file...

回答(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