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:
Putting a progress bar on a GUI - sorry, you're out of luck

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: ImageAnalyst

Date: 11 Dec, 2008 15:13:20

Message: 1 of 15

How can I put a progress bar onto my own custom GUI?

I know Ash asked this on Sept. 30th, and Walter said to check out
waitbar(), but this solution doesn't really work. For one thing,
waitbar brings up a completely separate window - it is not placed on
my main GUI.
Secondly, and most annoyingly, when my GUI is busy crunching away in
it's loop and displaying stuff (like images) on the GUI, the GUI comes
to the top and completely obscures the waitbar (which is now
underneath). I like to have my GUI's be full screen and a (bad)
workaround would be to make the GUI non-fullscreen, and try to arrange
the waitbar and GUI so that the waitbar does not get obscured, but
this is not really a nice solution.

Similarly there are several waitbar or progress bar functions uploaded
to the File Exchange but they're all separate windows and can't be
placed on your own custom GUI. GET A CLUE MATHWORKS! Look at the
most commonly searched terms on the FileExchange:
"abort ascii ascii progress bar bar class completion eta example
graphics gui gui tools interrupt merge meter ode process progress
progress bar progress text status terminate time left utilities wait
bar waitbar "
13 of the 25 terms of them are various names for showing progress or
completion. Doesn't that tell you something?????!!!!!

You should be able to have a progress bar placed on the GUI. MATLAB
only adds a built-in control every few years (most recently the table/
grid control). Why can't they add something as basic, simple, and
useful as a progress bar. I know I can add third party ActiveX
controls but for crying out loud, MATLAB should add this fundamental
essential control that will most likely get heavily user by their
customer. Like I said, over half the file exchange searches are for
such a capability!!!

So I guess the answer to my question is "You can't - unless you use
third party AcrtiveX controls" so my question will probably turn into
a request for enhancement for a future version.

Regards,
ImageAnalyst

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: Gavrilo Bozovic

Date: 11 Dec, 2008 16:05:18

Message: 2 of 15

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <a6b98772-2bb0-4a16-932a-918c1d1cf1c8@k19g2000yqg.googlegroups.com>...
> How can I put a progress bar onto my own custom GUI?
>
> I know Ash asked this on Sept. 30th, and Walter said to check out
> waitbar(), but this solution doesn't really work. For one thing,
> waitbar brings up a completely separate window - it is not placed on
> my main GUI.
> Secondly, and most annoyingly, when my GUI is busy crunching away in
> it's loop and displaying stuff (like images) on the GUI, the GUI comes
> to the top and completely obscures the waitbar (which is now
> underneath). I like to have my GUI's be full screen and a (bad)
> workaround would be to make the GUI non-fullscreen, and try to arrange
> the waitbar and GUI so that the waitbar does not get obscured, but
> this is not really a nice solution.
>
> Similarly there are several waitbar or progress bar functions uploaded
> to the File Exchange but they're all separate windows and can't be
> placed on your own custom GUI. GET A CLUE MATHWORKS! Look at the
> most commonly searched terms on the FileExchange:
> "abort ascii ascii progress bar bar class completion eta example
> graphics gui gui tools interrupt merge meter ode process progress
> progress bar progress text status terminate time left utilities wait
> bar waitbar "
> 13 of the 25 terms of them are various names for showing progress or
> completion. Doesn't that tell you something?????!!!!!
>
> You should be able to have a progress bar placed on the GUI. MATLAB
> only adds a built-in control every few years (most recently the table/
> grid control). Why can't they add something as basic, simple, and
> useful as a progress bar. I know I can add third party ActiveX
> controls but for crying out loud, MATLAB should add this fundamental
> essential control that will most likely get heavily user by their
> customer. Like I said, over half the file exchange searches are for
> such a capability!!!
>
> So I guess the answer to my question is "You can't - unless you use
> third party AcrtiveX controls" so my question will probably turn into
> a request for enhancement for a future version.
>
> Regards,
> ImageAnalyst

A quick and dirty solution:

h=waitbar(x);
set(h,'windowstyle','modal');

this way, the waitbar should always remain on top of the GUI. It's better than making the GUI smaller than fullsize, but still not very elegant...

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: Doug Schwarz

Date: 11 Dec, 2008 16:19:47

Message: 3 of 15

In article
<a6b98772-2bb0-4a16-932a-918c1d1cf1c8@k19g2000yqg.googlegroups.com>,
 ImageAnalyst <imageanalyst@mailinator.com> wrote:

> How can I put a progress bar onto my own custom GUI?

Come on, you could have written it in barely more time than it took you
to rant. Okay, sometimes it's feels good to rant. :-)

Anyway, I wrote this for you. Merry Christmas or <insert preferred
holiday here>!


function h = uiwaitbar(varargin)
%uiwaitbar: A waitbar that can be embedded in a GUI figure.
% Syntax:
% POSITION = [20 20 200 20]; % Position of uiwaitbar in pixels.
% H = uiwaitbar(POSITION);
% for i = 1:100
% uiwaitbar(H,i/100)
% end
 
% written by Doug Schwarz, 11 December 2008
 
if ishandle(varargin{1})
    ax = varargin{1};
    value = varargin{2};
    p = get(ax,'Child');
    x = get(p,'XData');
    x(3:4) = value;
    set(p,'XData',x)
    return
end
 
pos = varargin{1};
bg_color = 'w';
fg_color = 'r';
h = axes('Units','pixels',...
    'Position',pos,...
    'XLim',[0 1],'YLim',[0 1],...
    'XTick',[],'YTick',[],...
    'Color',bg_color,...
    'XColor',bg_color,'YColor',bg_color);
patch([0 0 0 0],[0 1 1 0],fg_color,...
    'Parent',h,...
    'EdgeColor','none',...
    'EraseMode','none');

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: ImageAnalyst

Date: 11 Dec, 2008 16:25:49

Message: 4 of 15

On Dec 11, 11:05=A0am, "Gavrilo Bozovic" <gavrilo.bozo...@helbling.ch>
wrote:
> ImageAnalyst <imageanal...@mailinator.com> wrote in message <a6b98772-2bb=
0-4a16-932a-918c1d1cf...@k19g2000yqg.googlegroups.com>...
> > How can I put a progress bar onto my own custom =A0GUI?
>
> > I know Ash asked this on Sept. 30th, and Walter said to check out
> > waitbar(), but this solution doesn't really work. =A0For one thing,
> > waitbar brings up a completely separate window - it is not placed on
> > my main GUI.
> > Secondly, and most annoyingly, when my GUI is =A0busy crunching away in
> > it's loop and displaying stuff (like images) on the GUI, the GUI comes
> > to the top and completely obscures the waitbar (which is now
> > underneath). =A0I like to have my GUI's be full screen and a (bad)
> > workaround would be to make the GUI non-fullscreen, and try to arrange
> > the waitbar and GUI so that the waitbar does not get obscured, but
> > this is not really a nice solution.
>
> > Similarly there are several waitbar or progress bar functions uploaded
> > to the File Exchange but they're all separate windows and can't be
> > placed on your own custom GUI. =A0GET A CLUE MATHWORKS! =A0Look at the
> > most commonly searched terms on the FileExchange:
> > "abort ascii ascii progress bar bar class completion eta example
> > graphics gui gui tools interrupt merge meter ode process progress
> > progress bar progress text status terminate time left utilities wait
> > bar waitbar =A0"
> > 13 of the 25 terms of them are various names for showing progress or
> > completion. =A0Doesn't that tell you something?????!!!!!
>
> > You should be able to have a progress bar placed on the GUI. =A0MATLAB
> > only adds a built-in control every few years (most recently the table/
> > grid control). =A0Why can't they add something as basic, simple, and
> > useful as a progress bar. =A0I know I can add third party ActiveX
> > controls but for crying out loud, MATLAB should add this fundamental
> > essential control that will most likely get heavily user by their
> > customer. =A0Like I said, over half the file exchange searches are for
> > such a capability!!!
>
> > So I guess the answer to my question is "You can't - unless you use
> > third party AcrtiveX controls" so my question will probably turn into
> > a request for enhancement for a future version.
>
> > Regards,
> > ImageAnalyst
>
> A quick and dirty solution:
>
> h=3Dwaitbar(x);
> set(h,'windowstyle','modal');
>
> this way, the waitbar should always remain on top of the GUI. It's better=
 than making the GUI smaller than fullsize, but still not very elegant...- =
Hide quoted text -
>
> - Show quoted text -

---------------------------------------------------------------
Gavrilo:
Thanks for the tip. I just tried it and it doesn't exactly work. It
does stay on top but there are tons of "bonks." It's weird, every
time I put a breakpoint in the code, I can continue and there are no
beeps/bonks but if I take the breakpoint out, there are tons of them.
I tried to track it down a bit and it seems like it has something to
do with calling the axes() command to set focus to different axes on
my GUI. Whenever I want to display an image or plot something I need
to call the axes() function to make sure it happens in the desired
axes. I even tried calling figure(handles.figMainWindow) to set focus
to my main GUI (instead of the waitbar) before I called the axes
command but that didn't work. I still get lots of annoying bonk
sounds.
- ImageAnalyst

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: Darik

Date: 11 Dec, 2008 17:25:04

Message: 5 of 15

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <a6b98772-2bb0-4a16-932a-918c1d1cf1c8@k19g2000yqg.googlegroups.com>...
> How can I put a progress bar onto my own custom GUI?
> [...]
> Regards,
> ImageAnalyst

Check out Yair Altman's statusbar on the fex. It's got a progress bar.

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: ImageAnalyst

Date: 11 Dec, 2008 18:17:05

Message: 6 of 15

On Dec 11, 11:19=A0am, Doug Schwarz <s...@sig.for.address.edu> wrote:
> In article
> <a6b98772-2bb0-4a16-932a-918c1d1cf...@k19g2000yqg.googlegroups.com>,
>
> =A0ImageAnalyst <imageanal...@mailinator.com> wrote:
> > How can I put a progress bar onto my own custom =A0GUI?
>
> Come on, you could have written it in barely more time than it took you
> to rant. =A0Okay, sometimes it's feels good to rant. =A0:-)
>
> Anyway, I wrote this for you. =A0Merry Christmas or <insert preferred
> holiday here>!
>
> function h =3D uiwaitbar(varargin)
> %uiwaitbar: A waitbar that can be embedded in a GUI figure.
> % =A0Syntax:
> % =A0 =A0POSITION =3D [20 20 200 20]; =A0% Position of uiwaitbar in pixel=
s.
> % =A0 =A0H =3D uiwaitbar(POSITION);
> % =A0 =A0for i =3D 1:100
> % =A0 =A0 =A0 =A0uiwaitbar(H,i/100)
> % =A0 =A0end
>
> % written by Doug Schwarz, 11 December 2008
>
> if ishandle(varargin{1})
> =A0 =A0 ax =3D varargin{1};
> =A0 =A0 value =3D varargin{2};
> =A0 =A0 p =3D get(ax,'Child');
> =A0 =A0 x =3D get(p,'XData');
> =A0 =A0 x(3:4) =3D value;
> =A0 =A0 set(p,'XData',x)
> =A0 =A0 return
> end
>
> pos =3D varargin{1};
> bg_color =3D 'w';
> fg_color =3D 'r';
> h =3D axes('Units','pixels',...
> =A0 =A0 'Position',pos,...
> =A0 =A0 'XLim',[0 1],'YLim',[0 1],...
> =A0 =A0 'XTick',[],'YTick',[],...
> =A0 =A0 'Color',bg_color,...
> =A0 =A0 'XColor',bg_color,'YColor',bg_color);
> patch([0 0 0 0],[0 1 1 0],fg_color,...
> =A0 =A0 'Parent',h,...
> =A0 =A0 'EdgeColor','none',...
> =A0 =A0 'EraseMode','none');
>
> --
> Doug Schwarz
> dmschwarz&ieee,org
> Make obvious changes to get real email address.

--------------------------------------------------
Thanks Doug. Works like a charm. One additional note, to get rid of
the waitbar, delete the handle:
% Get rid of the waitbar.
delete(hWaitBar);
I originally tried to set the visibility to "off" but that didn't
work. So I tried deleting the handle and that works.

It was a little bit of work to get it positioned correctly - not as
easy as just dragging it out in GUIDE - but I did get it where I
wanted by first placing a scroll bar on the figure, changing the units
property from characters to pixels (even though my figure was
normalized), noting the "position" property of the scroll bar, and
copying that to your POSITION variable.

I wasn't familiar with the "patch()" command, so I guess sometimes
ranting does get good results - much faster than waiting for the new
GUIDE, which they've been working on for quite a while with no
announced ETA (hopefully it will be a major improvement over these
tiny little interim improvements they've been making with the MATLAB
releases).

Thanks again,
ImageAnalyst
P.S. It would still be nice if such a control were built into GUIDE.

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: ImageAnalyst

Date: 11 Dec, 2008 18:28:32

Message: 7 of 15

On Dec 11, 1:17=A0pm, ImageAnalyst <imageanal...@mailinator.com> wrote:
> On Dec 11, 11:19=A0am, Doug Schwarz <s...@sig.for.address.edu> wrote:
>
>
>
>
>
> > In article
> > <a6b98772-2bb0-4a16-932a-918c1d1cf...@k19g2000yqg.googlegroups.com>,
>
> > =A0ImageAnalyst <imageanal...@mailinator.com> wrote:
> > > How can I put a progress bar onto my own custom =A0GUI?
>
> > Come on, you could have written it in barely more time than it took you
> > to rant. =A0Okay, sometimes it's feels good to rant. =A0:-)
>
> > Anyway, I wrote this for you. =A0Merry Christmas or <insert preferred
> > holiday here>!
>
> > function h =3D uiwaitbar(varargin)
> > %uiwaitbar: A waitbar that can be embedded in a GUI figure.
> > % =A0Syntax:
> > % =A0 =A0POSITION =3D [20 20 200 20]; =A0% Position of uiwaitbar in pix=
els.
> > % =A0 =A0H =3D uiwaitbar(POSITION);
> > % =A0 =A0for i =3D 1:100
> > % =A0 =A0 =A0 =A0uiwaitbar(H,i/100)
> > % =A0 =A0end
>
> > % written by Doug Schwarz, 11 December 2008
>
> > if ishandle(varargin{1})
> > =A0 =A0 ax =3D varargin{1};
> > =A0 =A0 value =3D varargin{2};
> > =A0 =A0 p =3D get(ax,'Child');
> > =A0 =A0 x =3D get(p,'XData');
> > =A0 =A0 x(3:4) =3D value;
> > =A0 =A0 set(p,'XData',x)
> > =A0 =A0 return
> > end
>
> > pos =3D varargin{1};
> > bg_color =3D 'w';
> > fg_color =3D 'r';
> > h =3D axes('Units','pixels',...
> > =A0 =A0 'Position',pos,...
> > =A0 =A0 'XLim',[0 1],'YLim',[0 1],...
> > =A0 =A0 'XTick',[],'YTick',[],...
> > =A0 =A0 'Color',bg_color,...
> > =A0 =A0 'XColor',bg_color,'YColor',bg_color);
> > patch([0 0 0 0],[0 1 1 0],fg_color,...
> > =A0 =A0 'Parent',h,...
> > =A0 =A0 'EdgeColor','none',...
> > =A0 =A0 'EraseMode','none');
>
> > --
> > Doug Schwarz
> > dmschwarz&ieee,org
> > Make obvious changes to get real email address.
>
> --------------------------------------------------
> Thanks Doug. =A0Works like a charm. =A0One additional note, to get rid of
> the waitbar, delete the handle:
> =A0 =A0 =A0 =A0 % Get rid of the waitbar.
> =A0 =A0 =A0 =A0 delete(hWaitBar);
> I originally tried to set the visibility to "off" but that didn't
> work. =A0So I tried deleting the handle and that works.
>
> It was a little bit of work to get it positioned correctly - not as
> easy as just dragging it out in GUIDE - but I did get it where I
> wanted by first placing a scroll bar on the figure, changing the units
> property from characters to pixels (even though my figure was
> normalized), noting the "position" property of the scroll bar, and
> copying that to your POSITION variable.
>
> I wasn't familiar with the "patch()" command, so I guess sometimes
> ranting does get good results - much faster than waiting for the new
> GUIDE, which they've been working on for quite a while with no
> announced ETA (hopefully it will be a major improvement over these
> tiny little interim improvements they've been making with the MATLAB
> releases).
>
> Thanks again,
> ImageAnalyst
> P.S. It would still be nice if such a control were built into GUIDE.- Hid=
e quoted text -
>
> - Show quoted text -

---------------------------------------
An additional note: because my main GUI had units of "normalized" so
that everything would scale properly if the user maximized the window,
the waitbar no longer was in the correct place if they did that
(because the units were pixels). I tried changing the units of the
axes to "normalized" after they it was created but it still left the
waitbar in the wrong place after maximizing. So I changed the units
to normalized when it was created with the axes command, and again
found the position by placing a "normalized-units" scrollbar in the
location that I wanted the waitbar, and then everything was fine. It
was in the right place when the window first came up and in the right
place after the GUi was maximized.
Thanks!

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: Glenn

Date: 17 Apr, 2009 20:31:01

Message: 8 of 15

FYI, a progress bar can be implemented.
Use a Slider Control with the Enable property set to Inactive. This prevents the slider from being moved by the user.
Change the Value property of the control from inside your coding to indicate progress.
The slider changes position according to the Value property.
The Value property must be between the Min and Max properties of the Slider Control but these can also be changed if necessary.
For progress labels (such as % complete) use a Static Text button just above the slider with text spaced appropriately so as to span the range of movement of the slider.

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <a6b98772-2bb0-4a16-932a-918c1d1cf1c8@k19g2000yqg.googlegroups.com>...
> How can I put a progress bar onto my own custom GUI?
>
> I know Ash asked this on Sept. 30th, and Walter said to check out
> waitbar(), but this solution doesn't really work. For one thing,
> waitbar brings up a completely separate window - it is not placed on
> my main GUI.
> Secondly, and most annoyingly, when my GUI is busy crunching away in
> it's loop and displaying stuff (like images) on the GUI, the GUI comes
> to the top and completely obscures the waitbar (which is now
> underneath). I like to have my GUI's be full screen and a (bad)
> workaround would be to make the GUI non-fullscreen, and try to arrange
> the waitbar and GUI so that the waitbar does not get obscured, but
> this is not really a nice solution.
>
> Similarly there are several waitbar or progress bar functions uploaded
> to the File Exchange but they're all separate windows and can't be
> placed on your own custom GUI. GET A CLUE MATHWORKS! Look at the
> most commonly searched terms on the FileExchange:
> "abort ascii ascii progress bar bar class completion eta example
> graphics gui gui tools interrupt merge meter ode process progress
> progress bar progress text status terminate time left utilities wait
> bar waitbar "
> 13 of the 25 terms of them are various names for showing progress or
> completion. Doesn't that tell you something?????!!!!!
>
> You should be able to have a progress bar placed on the GUI. MATLAB
> only adds a built-in control every few years (most recently the table/
> grid control). Why can't they add something as basic, simple, and
> useful as a progress bar. I know I can add third party ActiveX
> controls but for crying out loud, MATLAB should add this fundamental
> essential control that will most likely get heavily user by their
> customer. Like I said, over half the file exchange searches are for
> such a capability!!!
>
> So I guess the answer to my question is "You can't - unless you use
> third party AcrtiveX controls" so my question will probably turn into
> a request for enhancement for a future version.
>
> Regards,
> ImageAnalyst

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: Doug Schwarz

Date: 18 Apr, 2009 01:18:11

Message: 9 of 15

In article
<a6b98772-2bb0-4a16-932a-918c1d1cf1c8@k19g2000yqg.googlegroups.com>,
 ImageAnalyst <imageanalyst@mailinator.com> wrote:

> How can I put a progress bar onto my own custom GUI?
>

[snip]


I have one that I've been working in my spare time that eventually will
go up on the FEX. It's not done, but give me a couple of days to at
least make sure it's working and I'd be glad to send it to you. It's a
class using the new class syntax so you have to be using at least R2008a
to run it. I have tried to make it as much like a uicontrol as I can.

Use it like this:

  h = uiwaitbar('Position',[20 100 200 16]);
  for i = 1:100
    set(h,'Value',i/100)
  end

Send me an email to confirm your email address.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: ImageAnalyst

Date: 18 Apr, 2009 01:32:29

Message: 10 of 15

On Apr 17, 9:18=A0pm, Doug Schwarz <s...@sig.for.address.edu> wrote:
> In article
> <a6b98772-2bb0-4a16-932a-918c1d1cf...@k19g2000yqg.googlegroups.com>,
>
> =A0ImageAnalyst <imageanal...@mailinator.com> wrote:
> > How can I put a progress bar onto my own custom =A0GUI?
>
> [snip]
>
> I have one that I've been working in my spare time that eventually will
> go up on the FEX. =A0It's not done, but give me a couple of days to at
> least make sure it's working and I'd be glad to send it to you. =A0It's a
> class using the new class syntax so you have to be using at least R2008a
> to run it. =A0I have tried to make it as much like a uicontrol as I can.
>
> Use it like this:
>
> =A0 h =3D uiwaitbar('Position',[20 100 200 16]);
> =A0 for i =3D 1:100
> =A0 =A0 set(h,'Value',i/100)
> =A0 end
>
> Send me an email to confirm your email address.
>
> --
> Doug Schwarz
> dmschwarz&ieee,org
> Make obvious changes to get real email address.

---------------------------------------------------------------------------=
--------
Doug:
I've been using the code you posted earlier in this thread. It works
nicer than any I saw on the FEX so far. It's great that you're
working on converting it from a snippet into a full-fledged class.
Let me know (here) when it's done and I'll download it.

Does the "Position" arg depend on whether the units property of the
main figure are "normalized," "pixels," etc.?
Thanks,
ImageAnalyst

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: ImageAnalyst

Date: 18 Apr, 2009 01:35:20

Message: 11 of 15

On Apr 17, 4:31=A0pm, "Glenn " <JAG...@hotmail.com> wrote:
> FYI, a progress bar can be implemented.
> Use a Slider Control with the Enable property set to Inactive.
[snip]
------------------------------------------------------------------
Glenn:
Yes that's true, but Doug's solution is a much nicer looking solution,
so I'll continue to use that. By the way, I haven't yet downloaded
R2009a - does that have a built-in progress bar?
Thanks,
ImageAnalyst

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: Doug Schwarz

Date: 18 Apr, 2009 05:49:57

Message: 12 of 15

In article
<36d79543-ad5c-4de8-9011-652b115de6de@r37g2000yqn.googlegroups.com>,
 ImageAnalyst <imageanalyst@mailinator.com> wrote:

> On Apr 17, 9:18

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: Glenn

Date: 24 Apr, 2009 19:08:01

Message: 13 of 15

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <2068a6ca-3a45-4564-ad90-0a92d8f92ff8@k8g2000yqn.googlegroups.com>...
> On Apr 17, 4:31=A0pm, "Glenn " <JAG...@hotmail.com> wrote:
> > FYI, a progress bar can be implemented.
> > Use a Slider Control with the Enable property set to Inactive.
> [snip]
> ------------------------------------------------------------------
> Glenn:
> Yes that's true, but Doug's solution is a much nicer looking solution,
> so I'll continue to use that. By the way, I haven't yet downloaded
> R2009a - does that have a built-in progress bar?
> Thanks,
> ImageAnalyst

No it does not.

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: Travis

Date: 26 May, 2009 23:32:03

Message: 14 of 15

"Glenn " <JAGGKG@hotmail.com> wrote in message <gsaou5$l8l$1@fred.mathworks.com>...
> FYI, a progress bar can be implemented.
> Use a Slider Control with the Enable property set to Inactive. This prevents the slider from being moved by the user.
> Change the Value property of the control from inside your coding to indicate progress.
> The slider changes position according to the Value property.
> The Value property must be between the Min and Max properties of the Slider Control but these can also be changed if necessary.
> For progress labels (such as % complete) use a Static Text button just above the slider with text spaced appropriately so as to span the range of movement of the slider.
>

OK, I have a "Process" button on my GUI that runs code. How do i modify something on the GUI from within the other code? I know exactly how I would like to set it, I just don't know how.

Subject: Putting a progress bar on a GUI - sorry, you're out of luck

From: Sue

Date: 15 Jul, 2011 10:10:12

Message: 15 of 15

This seems to be a good progress bar by reading all the comments here but I am new to MATLAB gui's and GUIDE and would like to ask - where abouts would I include this code to make a progress bar appear once a pushbutton has been pressed by the user.

To make things clearer, I am using GUIDE and have a pushbutton which activates an underlying m-file which takes 5-7 mins to run. Instead of the user sitting there wondering whether anything is happening, I wish to put a progress bar on the screen (again not opening up in a separate window) as an indication that yes something is happening albeit in the background.

So my main question is - whereabout would I put this piece of code? And please don't forget, try and explain it clearly and carefully - I really am like a 5 year old trying to learn to read all over again!!

Many thanks, Sue

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