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:
Generate 'program running symbol' in GUI

Subject: Generate 'program running symbol' in GUI

From: sk maidul haque

Date: 23 Nov, 2011 07:24:08

Message: 1 of 3

Can somebody tell me how to generate some running type of symbol in GUI so that when user clicks on run command, that running symbol indicate that the program is running or busy.
Thanks in advance.

Subject: Generate 'program running symbol' in GUI

From: Chandra Kurniawan

Date: 23 Nov, 2011 07:47:08

Message: 2 of 3

"sk maidul haque" <skmaidulhaque@gmail.com> wrote in message <jai72o$gsp$1@newscl01ah.mathworks.com>...
> Can somebody tell me how to generate some running type of symbol in GUI so that when user clicks on run command, that running symbol indicate that the program is running or busy.
> Thanks in advance.
=====================================================
Hi, maidul.
Here try my code bellow
----------------------------------
function GUI1(action)
global G;
if nargin == 0
    action = 'initialize';
end
switch action
    case 'initialize'
        G.Fig = figure('unit','pixel','position',[300 300 200 100]);
        G.Text = uicontrol('unit','pixel','style','text','position',[0 0 200 20],'string','status : ready');
        G.Button = uicontrol('unit','pixel','style','pushbutton','position',[0 20 75 25],'string','RUN','callback','GUI1 pressed');
    case 'pressed'
        set(G.Text,'string','status : running');
        for x = 1 : 20
            disp(x);
            pause(0.5);
        end
        set(G.Text,'string','status : finished');
end
------------------------------------------------------------
Just save it with filename 'GUI1.m' and then press F5.
When you click the 'RUN' button on my GUI, the text will show you 'status : running' and the program will display 1, 2, 3 ,... 20 on the command window.
And when it finished, it will show you 'status : finished'.

Subject: Generate 'program running symbol' in GUI

From: Steven_Lord

Date: 28 Nov, 2011 15:10:52

Message: 3 of 3



"sk maidul haque" <skmaidulhaque@gmail.com> wrote in message
news:jai72o$gsp$1@newscl01ah.mathworks.com...
> Can somebody tell me how to generate some running type of symbol in GUI so
> that when user clicks on run command, that running symbol indicate that
> the program is running or busy.
> Thanks in advance.

You may want to use a WAITBAR for this purpose, or change the figure's
Pointer property to something like 'watch'.

http://www.mathworks.com/help/techdoc/ref/figure_props.html#Pointer

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

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