Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to create simply a window with information about the processing for a GUI?

Subject: How to create simply a window with information about the processing for a GUI?

From: Camille Couzi

Date: 19 Sep, 2011 05:20:29

Message: 1 of 7

Hi!!

I have created a GUI that process some data within a folder that contains some files. when I was running the GUI as a program on matlab I was displaying messages in the command window in order to give information to the user, as for example:
disp('please wait...')
disp('the file1 has been processed succesfully')
disp('the file2 has been processed succesfully')
ect...

Now I am trying to make a stand alone application with the Matlab compiler, and of course when I create it and I launch it, I can't see these messages anymore, as I am not using Matlab.
How can I simply make a window appear with this kind of messages, but I want then all together in the same window (not one window by message), because if I have 100 messages it will be crazy!

Thanks a lot for your answers...

Subject: How to create simply a window with information about the processing for a GUI?

From: Bruno Luong

Date: 19 Sep, 2011 08:13:27

Message: 2 of 7

"Camille Couzi" <cco@dhi.com.sg> wrote in message <j56jet$s6k$1@newscl01ah.mathworks.com>...
> Hi!!
>
> I have created a GUI that process some data within a folder that contains some files. when I was running the GUI as a program on matlab I was displaying messages in the command window in order to give information to the user, as for example:
> disp('please wait...')
> disp('the file1 has been processed succesfully')
> disp('the file2 has been processed succesfully')
> ect...
>
> Now I am trying to make a stand alone application with the Matlab compiler, and of course when I create it and I launch it, I can't see these messages anymore, as I am not using Matlab.
> How can I simply make a window appear with this kind of messages, but I want then all together in the same window (not one window by message), because if I have 100 messages it will be crazy!
>
> Thanks a lot for your answers...

h=msgbox('loading...','Info');
txth = findobj(h,'Type','text');
pause(1); set(txth, 'String', 'computing...');
pause(1); set(txth, 'String', 'post processing...');
pause(1); delete(h)

% Bruno

Subject: How to create simply a window with information about the processing for a GUI?

From: Camille Couzi

Date: 19 Sep, 2011 08:44:13

Message: 3 of 7

Hi bruno,
thanks a lot for your answer.
This code replace each time the text inside the message box. How can I make the text to be written after the previous message?
for example;
 1st message:
'Info'

2nd message:
'Info'
'Computing'

3rd message:
'Info'
'Computing'
'Processing the data'

ect...
(and set a maximum number of lines so that when the number of messages reaches this max number of lines, there is a vertical slide at the right of the box so that we can still see the previous informations...
Am I asking too much?!!!
thanks again

Subject: How to create simply a window with information about the processing for a GUI?

From: Camille Couzi

Date: 19 Sep, 2011 09:56:28

Message: 4 of 7

Hi again!
I have made a trial, maybe it could be something like that:

%%%%%%%%%%%%start of code
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','text');

set(text_box,'string','Doing something...');

pause(3);

old_msg=get(text_box, 'String');
l=size(old_msg,1);
new_msg=cell(l+1,1);
new_msg(1:l,1)={old_msg};
new_msg(l+1,1)={'computing...'};
set(text_box, 'String',new_msg)
pause(3);

old_msg=get(text_box, 'String');
l=length(old_msg);
new_msg=cell(l+1,1);
new_msg(1:l,1)=old_msg;
new_msg(l+1,1)={'adding rows...'};
set(text_box, 'String',new_msg)
pause(3);

old_msg=get(text_box, 'String');
l=length(old_msg);
new_msg=cell(l+1,1);
new_msg(1:l,1)=old_msg;
new_msg(l+1,1)={'doing more things...'};
set(text_box, 'String',new_msg)
pause(3);

close(fig)
%%%%%%%%%%end of code
but when the text reaches the bottom of my window I can't see the new text... :-(
somebody can help me?!

Subject: How to create simply a window with information about the processing for a GUI?

From: Bruno Luong

Date: 19 Sep, 2011 11:48:07

Message: 5 of 7

'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

Subject: How to create simply a window with information about the processing for a GUI?

From: Yair Altman

Date: 19 Sep, 2011 16:19:26

Message: 6 of 7

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <j57a5n$fgi$1@newscl01ah.mathworks.com>...
> '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).


One possible example of using a scrollable listbox of log events, with associated event icons, is presented here:
http://UndocumentedMatlab.com/blog/rich-matlab-editbox-contents/

Yair Altman
http://UndocumentedMatlab.com

Subject: How to create simply a window with information about the processing for a GUI?

From: Camille Couzi

Date: 20 Sep, 2011 01:08:30

Message: 7 of 7

ey bruno, that was EXACTLY what i was searching for!!!! thank you SO MUCH!!!!!
cheers from singapore! :-)

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us