Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to create simply a window with information about the processing for a GUI?
Date: Mon, 19 Sep 2011 11:48:07 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 37
Message-ID: <j57a5n$fgi$1@newscl01ah.mathworks.com>
References: <j56jet$s6k$1@newscl01ah.mathworks.com> <j56tj7$312$1@newscl01ah.mathworks.com> <j56vct$8u8$1@newscl01ah.mathworks.com> <j573kc$n5a$1@newscl01ah.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-06-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1316432887 15890 172.30.248.38 (19 Sep 2011 11:48:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 19 Sep 2011 11:48:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:743498

'Listbox' can have scrollbar, if you don't want to hack some low-level Java stuffs (Check out Yair's undocumented blog that might have something along that line).

%%%%%

fig=figure('position',[400 400 300 250],'menubar','none',...
    'toolbar','none','name','Information','numbertitle','off');
text_box=uicontrol(fig,'units','normalized','position',[0.02 0.02 0.96 0.96],...
    'style','listbox');

set(text_box,'string',{});
for k=1:10

    msg=get(text_box, 'String');
    msg(end+1)={'Doing something...'};   
    set(text_box, 'String',msg, 'Value',length(msg))
    pause(0.3);
    
    msg=get(text_box, 'String');
    msg(end+1)={'computing...'};
    set(text_box, 'String',msg, 'Value',length(msg))
    pause(0.3);
    
    msg=get(text_box, 'String');
    msg(end+1)={'adding rows...'};
    set(text_box, 'String',msg, 'Value',length(msg))
    pause(0.3);
    
    msg=get(text_box, 'String');
    msg(end+1)={'doing more things...'};
    set(text_box, 'String',msg, 'Value',length(msg))
    pause(0.3);
    
end

close(fig)

% Bruno