Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Putting a progress bar on a GUI - sorry, you're out of luck
Date: Thu, 11 Dec 2008 16:05:18 +0000 (UTC)
Organization: Helbling Technik Bern AG
Lines: 48
Message-ID: <ghrdnu$jco$1@fred.mathworks.com>
References: <a6b98772-2bb0-4a16-932a-918c1d1cf1c8@k19g2000yqg.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1229011518 19864 172.30.248.35 (11 Dec 2008 16:05:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 11 Dec 2008 16:05:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1271984
Xref: news.mathworks.com comp.soft-sys.matlab:506366


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...