Code covered by the BSD License  

Highlights from
Improved waitbar

4.66667

4.7 | 3 ratings Rate this file 9 Downloads (last 30 days) File Size: 5.59 KB File ID: #23169

Improved waitbar

by Ross Hatton

 

03 Mar 2009

Progress bar (waitbar) that can be embedded into a GUI uipanel element and/or decremented.

| Watch this File

File Information
Description

The standard WAITBAR function (and the improved WAITBAR2 function, which this code is based on) must appear in their own figure windows, and cannot be embedded into a GUI. They also display incorrectly if the progress is reduced (e.g., when resetting an embedded progress bar).

WAITBAR2A is a drop-in replacement for either of the earlier functions, that has the additional capability to be initialized with the handle of a uipanel, in which case it draws into that uipanel rather than a new figure, and to be decremented.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Waitbar2

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
27 Apr 2009 Anton Semechko

Works great ... generic MatLab waitbar has really limited use as it cannot be easily incorporated directly into a GUI ... but this one does the trick. Thanks !!!

16 Nov 2010 Celine Cluzel  
16 Nov 2011 Jeff Warner

I managed to get it embedded in a GUI but I want to change the size of the waitbar. How do I accomplish that? Is there a specific example? Does the updated text always appear above the waitbar or can it appear inside the waitbar?

16 Nov 2011 Ross Hatton

The waitbar sizes itself to the uipanel it is embedded in, and places the text accordingly. If you want to change this geometry, you can either modify the handle structure directly (the same as if you were setting up custom axes on a plot), or modify the code in "case 3" of the switch statement.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
waitbar Ross Hatton 04 Mar 2009 14:31:05
gui Ross Hatton 04 Mar 2009 14:31:05
uipanel Ross Hatton 04 Mar 2009 14:31:05
waitbar Jeff Warner 16 Nov 2011 10:36:17

Contact us at files@mathworks.com